Re: [PATCH 1/2] kthread_create

From: Davide Libenzi
Date: Wed Jan 07 2004 - 02:27:19 EST


On Wed, 7 Jan 2004, Rusty Russell wrote:

> In message <Pine.LNX.4.44.0401042243510.16042-100000@xxxxxxxxxxxxxxxxxxxxxxx> you write:
> > On Mon, 5 Jan 2004, Rusty Russell wrote:
> > > 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.
>
> Thinking more about this issue lead me to rewrite the code to be
> simpler to use. Main benefit is that the transition from existing
> code is minimal.
>
> Latest version of patch, and code which uses it. It's actually quite
> neat now. Changes since first version:
>
> 1) kthread_start() deleted in favor of wake_up_process() directly.
> 2) New kthread_bind() for just-created threads, to replace original
> migration thread open-coded version.
> 3) Slight simplification: thread named only if spawned OK.

Yes, I like this better. Without any doubt, the removal of sync'd start
function simplified things a lot.



- 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/