Re: [PATCH 1/2] kthread_create

From: Davide Libenzi
Date: Mon Jan 05 2004 - 01:53:51 EST


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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/