Give the solution if the following rule is added


Problem

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)
}

1. Give a solution to the problem for three processes P1, P2, and P3.

2. 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.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Give the solution if the following rule is added
Reference No:- TGS03333247

Expected delivery within 24 Hours