Semaphore S=1, there are 5 processes po,p1,p2,p3,p4 execute the following code
p0 to p3 execute while (1) { P(S) <CS.> V(S) } | p4 execute {P(S) <CS.> V(S)} |
|---|
How many maximum number of processes can be present in critical section at any point of time?
Номенклатура справи забезпечує
Binary semaphore S1=1 and S2=1
int x=10
| p0(){ p(s1) p(s2) x=x+1 v(s2) v(s1)} | ------------ | p1(){ p(s2) p(s1) x=x+1 v(s2) v(s1)} |
|---|
what will be the value of x after execution of p0 and p1?