linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Going to sleep atomically
@ 2001-03-08 13:37 Ralph Blach
  2001-03-08 14:25 ` speed and space Optimization Srinivas Rao.M
  0 siblings, 1 reply; 11+ messages in thread
From: Ralph Blach @ 2001-03-08 13:37 UTC (permalink / raw)
  To: Embedded Linux list

[-- Attachment #1: Type: text/plain, Size: 81 bytes --]

In a device driver, What is the best way to go to sleep atomically?

Thanks

Chip

[-- Attachment #2: Card for Ralph Blach --]
[-- Type: text/x-vcard, Size: 247 bytes --]

begin:vcard
n:Blach;Ralph
tel;work:919-543-1207
x-mozilla-html:TRUE
url:www.ibm.com
org:IBM MicroElectronics
adr:;;3039 Cornwallis		;RTP;NC;27709;USA
version:2.1
email;internet:rcblach@raleigh.ibm.com
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Going to sleep atomically
@ 2001-03-08 14:12 Kári Davíðsson
  2001-03-08 16:42 ` Roland Dreier
  0 siblings, 1 reply; 11+ messages in thread
From: Kári Davíðsson @ 2001-03-08 14:12 UTC (permalink / raw)
  To: Embedded Linux list


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

in poll() use poll_wait()

K.D.

P.S.
"Linux Device Drivers" by Rubini is an excellent guide to driver
writing, although
it is getting quite old (in kernel-time space).
Other drivers can serve as tutrials too.

K.D.

> -----Original Message-----
> From: Ralph Blach [mailto:rcblach@raleigh.ibm.com]
> Sent: 8. mars 2001 13:38
> To: Embedded Linux list
> Subject: Going to sleep atomically
>
>
> In a device driver, What is the best way to go to sleep atomically?
>
> Thanks
>
> Chip
>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Going to sleep atomically
@ 2001-03-08 20:51 Kári Davíðsson
  0 siblings, 0 replies; 11+ messages in thread
From: Kári Davíðsson @ 2001-03-08 20:51 UTC (permalink / raw)
  To: Embedded Linux list


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/

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-03-09  0:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-08 13:37 Going to sleep atomically Ralph Blach
2001-03-08 14:25 ` speed and space Optimization Srinivas Rao.M
2001-03-08 14:54   ` Gabriel Paubert
2001-03-08 15:18     ` Srinivas Rao.M
2001-03-08 15:48       ` Gabriel Paubert
2001-03-08 23:47         ` Graham Stoney
2001-03-09  0:26           ` Gabriel Paubert
2001-03-08 17:18     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2001-03-08 14:12 Going to sleep atomically Kári Davíðsson
2001-03-08 16:42 ` Roland Dreier
2001-03-08 20:51 Kári Davíðsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).