Hey guys, I have a midterm coming up and I am confused on this one question. Any help would be greatly appreciated.
Two processes (P0, P1) are running at the same time. We want to preserve the critical section with two semaphores (S, Q) with initial value 1.
P1 P2
wait(S) wait(Q)
wait(Q) wait(S)
//Critical Section //Critical Section
signal(S) signal(Q)
signal(Q) signal(S)
What is the problem with the solution above and how can you correct this?