Re: [PATCH 1/2] kthread_create

Rusty Russell
2003-12-31T05:30:36Z

In message <3FF251B1.4070404@pobox.com> you write:
> Rusty Russell wrote:
> > Hi all,
> >
> > Ingo read through this before and liked it: this is the basis
> > of the Hotplug CPU patch, and as such has been stressed fairly well.
> > Tested stand-alone, and included here for wider review.
>
> Hey, this is pretty cool.
>
> Recalling threads from LKML past, there are two mechanisms I (and some
> others) felt were missing from the equally nifty workqueue stuff:
> 1) one-shot threads
> 2) keventd overflow
>
> For #1, your patch seems to cover that nicely.

It's really for persistent threads, but you can use it as one-shot by
either (1) calling exit() in the core function (and noone calls
kthread_destroy), or (2) not having a core function and just having an
init function. I used this in a test patch.

For #2, if you really can't wait for keventd, perhaps your own
workqueue is in order?

> Anyway, thanks for doing this, it fills a need, I believe.

Yes: stopping threads manually is a real PITA, and things like
complete_and_exit() always make me wince.

Thanks,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.