This solution does not work.
Assume following specific case.
Let queue is full and Producer is holding the mutex say P1.
P1 will go into critical section and execute code on L3. It will check for if queue is full or not if queue is full then it again loop back to L2 and again try to acquire lock on critical section. So it will continue to loop back this way .
Mean while consumer will wait for producer to release the lock which will not happen so dead lock situation will happen.
Consider the Producer-Consumer problem Assume that there are 2 producers (P1 and P2) and 1 consumer...
1) Producer/Consumer again Consider the bounded buffer Producer/Consumer problem we discussed in class. Assume the buffer size is now 10. Assume the Producer process enters 3 items at a time into the buffer. It will only do this if there are at least 3 empty spots in the buffer. Assume the Consumer process will remove items two at a time, and will only do so if there are at least two items in the buffer. In addition to the Producer...