132
P/C: unbounded buffer
nRemarks:
uPutting 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
uThe consumer must perform wait(N) before wait(S), otherwise deadlock occurs if consumer enter CS while the buffer is empty
nUsing semaphores is a difficult art...