📝 Question
#158
The program follows to use a shared binary semaphore T. Process A int Y; A1: Y = X*2; A2: X = Y; signal(T); Process B int Z; B1: wait(T); B2: Z = X+1; X = Z;
✓
Correct Answer
A. one
💡
Explanation
The semaphore T ensures that all the statements from A finish execution before B begins. So now there is only one way in which statements from A and B can be interleaved:
⌨️ Press
A
B
C
D
to select