DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Notice that unlike the mutual exclusion case above, sem_wait() and sem_post() are called on diferent different threads.
Usage in Drivers.
This usage case is used often within drivers, for example, when the user calls the read() method and there is no data available. sem_wait() is called to wait for new data to be received; sem_post() is called when the new data arrives and the user task is re-awakened.
...
Ideally sem_setprotocol(SEM_PRIO_NONE) should be called for all signaling semaphores. But, no, often the use of a signaling semaphore with priority inversion is not a problem. It is not a problem if the signaling semaphore is always taken on the same thread. For example:
- If the driver us is used by only a single taskstask, or
- If the semaphore is only taken on the worker thread.
...