RE: Wait queue question
From: Ian Abbott <abbotti@mev.co.uk>
Date: 2001-02-14 18:04:07
Ralph Blach wrote:
If I have a wait queue thats I am using to wake up a device driver read from an interrupt service routine. If I get three interrupt and three wake_up_interrables, will I need to execute three sleep_ons to get the wait queue back to the null state, or is it just back after the first sleep_on?
They do not work like semaphores. wake_up and wake_up_interruptible have an immediate effect on processes waiting on the specified queue, but don't modify a counter or anything like that. This also means you can't sleep on an event that has already happened, like you could with a semaphore. Also, you probably want to use interruptible_sleep_on rather than sleep_on, unless you've already considered this. These are general Linux driver writing questions, rather than embedded Linux PPC questions. You may be better off addressing these sorts of questions to a different list or newsgroup. Also, you may wish to consider investing in Alessandro Rubini's "Linux Device Drivers", published by O'Reilly. It's starting to get a little out-of-date in places but is still a good introduction to writing device drivers for Linux. ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/