RE: Going to sleep atomically

From: Kári Davíðsson <hidden>
Date: 2001-03-08 20:51:11

Oooops.
Sorry for the confusion.

I stand corrected.

K.D.
-----Original Message-----
From: Roland Dreier [mailto:roland@topspincom.com]
Sent: 8. mars 2001 16:42
To: Embedded Linux list
Cc: Kári Davíðsson
Subject: Re: Going to sleep atomically



    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