The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.
How many times will P0 print ‘0’?
Process P0
while(true)
{
wait(S0);
print '0';
release(S1);
release(S2);
}
Process P1
wait(S1);
release(S0);
Process P2
wait(S2);
release(S0);
The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.
How many times will P0 print ‘0’?
Process P0
while(true)
{
wait(S0);
print '0';
release(S1);
release(S2);
}
Process P1
wait(S1);
release(S0);
Process P2
wait(S2);
release(S0);
* השאלה נוספה בתאריך: 20-07-2020