PPT Slide
Semaphores
- New semaphore SOS calls:
- int Signal(int sema_id) - If the wait queue of the specified ID is empty, set the state of the semaphore to not busy. If the wait queue is not empty, remove some process from the queue and unblock that process.
- int DetachSemaphore(int sema_id) - indicate to the operating system that this process no longer is using sema_id.
- These are binary semaphores, meaning they are either busy or not busy. Pseudo-code for their implementation is on page 310. To work, Wait() and Signal() must be atomic (allowed to execute completely before the process is switched out).