Thread (1 message) 1 message, 1 author, 2001-03-08

Re: Going to sleep atomically

From: Roland Dreier <hidden>
Date: 2001-03-08 16:42:26

    KD> Like in blocking read() and poll() etc?
    KD> interruptable_sleep_on() or sleep_on()

No!!  Do _not_ use sleep_on() in new code.  It isn't atomic (there is
a race condition where you will miss the wakeup).  In an earlier post
to this mailing list
(<http://lists.linuxppc.org/listarcs/linuxppc-embedded/200102/msg00093.html>)
I gave the following good advice:

    You really don't want to use sleep_on() any more (Linus wants to
    remove it for 2.5).  Take a look at

    <http://lwn.net/2001/0201/a/sleep-fix.php3>

    for a safer way to sleep, or use the wait_event macro (in
    linux/sched.h).

Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help