Re: [PATCH 1/2] kthread_create

Davide Libenzi
2004-01-05T06:52:31Z

On Mon, 5 Jan 2004, Rusty Russell wrote:

> > But I think it can be avoided, and actually I
> > don't know why I did not think about this before. We don't need to return
> > a struct task_struct* for kthread_create(). We can have:
> >
> > struct kthread_struct {
>
> Nope. That's EXACTLY the kind of burden on the caller I wanted to
> avoid if at all possible.

Which burden? The kthread is a resource and a "struct kthread" is an
handle to the resource. You create the resource (kthread_create()), you
control the resource (kthread_start()) and you free the resource
(kthread_stop()). To me it's simple and clean and does not require hacks
like taking owerships of tasks and using SIGCLD/waitpid to communicate.
Anyway, that's your baby and you'll take your choice.

- Davide