Question - What differences are there between a semaphore wait signal and a condition variable wait signal?
Answer -
Semaphore wait signal:
- They can be used anywhere except in a monitor.
- The wait() function does not always blocks its caller.
- The signal() function increments the semaphore counter and can release a process.
- If the signal() releases a process, the released and the caller both continue.
Condition Variable wait signal:
- It can only be used in monitors.
- The wait() function always blocks its caller.
- The signal() can either release a process or it is lost as if it never occurred.
- On signal() releasing a process either the caller or the released continues but not both at the same time.