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 0.
Process p1 executes the following code:
s.wait();
s.wait();
s.signal();
Process p2 executes the following code:
s.signal();
s.signal();
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!