|
|
|
|
|
|
|
|
|
|
|
|
|
n |
Remarks:
|
|
|
|
u |
Putting signal(N)
inside the CS of the producer
|
|
|
|
(instead of
outside) has no effect since the
|
|
|
consumer must
always wait for both
|
|
|
|
semaphores before
proceeding
|
|
|
|
u |
The consumer must
perform wait(N) before
|
|
|
wait(S),
otherwise deadlock occurs if consumer
|
|
|
enter CS while
the buffer is empty
|
|
|
n |
Using
semaphores is a difficult art...
|
|