Question: Initially you have a semaphore s set to 0 . Process p 1 executes the following code: s . wait ( ) ; s .
Initially you have a semaphore s set to
Process p executes the following code:
swait;
swait;
ssignal;
Process p executes the following code:
ssignal;
ssignal;
What is the value of s after both the processes terminate? Which process will have its first statement terminate first?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
