Two concurrent processes P and Q execute the following code.
Two concurrent processes P and Q execute the following code.
Process P:
while(True){
W: ____
print('0'); print('0');
X: ____
}
Process Q:
while(True){
Y: ____
print('1'); print('1');
Z: ____
}
Given S and T are binary semaphore variables, and P() and V() as standard "wait" and "signal" functions respectively. What should be the semaphore operations W, X, Y, and Z for the output string: 11001100…?
Show answerHide answer
Correct answer: (A) W=P(T), X=V(S), Y=P(S), Z=V(T), S=1, T=0