Re: [PATCH 1/2] kthread_create

Rusty Russell
2004-01-01T23:34:42Z

In message <Pine.LNX.4.44.0312302255080.1457-100000@bigblue.dev.mdolabs.com> you write:
> On Wed, 31 Dec 2003, Srivatsa Vaddagiri wrote:
>
> > The messages should not be lost because we take the cpucontrol
> > semaphore in kthread_start or kthread_destroy before sending
> > a (start or destroy) message.
>
> I see, ok. At that point though, having the message struct inside the task
> struct could save the *to pointer and (because of the big lock above), using
> barrier and proper order in setting *from and *info, the spin lock.

My original version used barriers. But IMHO if you're using barriers
and your code isn't speed-critical, you don't have enough locks.

So I just threw a spinlock around the struct, and no more barrier
issues.

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