On 19/02/2008, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
Yes, but only when it's used in combination with something that alters
a state of the task.
So it's rather a question of the interface-design.
We currently impose a requirement on how a main loop of 'kthread'
threads (ok, so it seems to dictate a policy :-) has to be orginized.
Namely, the following sequence must be kept in order:
(1) set_current_task(TASK_INTERRUPTIBLE);
(2) kthread_should_stop()
...
- schedule()
and (1) already provides a mb which becomes a "matching barrier" on
the kthread_should_stop() side.
--
Best regards,
Dmitry Adamushko
--