Question: Sometimes it is necessary to synchronize two or more processes so that all process must finish their first phase before any of them is allowed

Sometimes it is necessary to synchronize two or more processes so that all process must finish their first phase before any of them is allowed to start its second phase. For two processes, we might write:

semaphore s1 = 0, s2 = 0;

process P1 { V (s1) P (s2)

process P2 { V (s2) P (s1)

}}

a) Give a solution to the problem for three processes P1, P2, and P3. b) Give the solution if the following rule is added: after all processes finish their first phase,

phase I, they must execute phase II in order of their number; that is P1, then P2 and finally P3.Sometimes it is necessary to synchronize two or more processes so that

Question #6 Sometimes it is necessary to synchronize two or more processes so that all process must finish their first phase before any of them is allowed to start its second phase. For two processes, we might write: semaphore sl = 0, s2 = 0; process P1 { V (sl) P (52) process P2 { V (2) P (sl) a) Give a solution to the problem for three processes P1, P2, and P3. b) Give the solution if the following rule is added: after all processes finish their first phase, phase I, they must execute phase II in order of their number; that is P1, then P2 and finally P3

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!