in Operating System
486 views
0 votes
0 votes

Each Process Pi, i = 1....91....9 is coded as follows

while(TRUE)
{ 
    P(mutex)
    {Critical section}
    V(mutex)
}

The code for P10 is 

while (TRUE)
{ 
    v(mutex)
    {Critical section}
    p(mutex)
}

. What is the largest number of processes that can be inside the critical section at any moment?

  1. 1
  2. 2
  3. 3
  4. 10
in Operating System
486 views

1 comment

if value of binary semaphore initially is 1 then 3 processes can enter into CS at max at a time

any process from $P_0$ to $P_9$ can enter and will make value 0

then process $P_{10}$ can enter and make value 1 again

then any other process can enter and make 0 again

0
0

1 Answer

1 vote
1 vote

Initially mutex = 1

Let ,

P1 enters by P operation---> mutex=0

P10 enters by V operation ---> mutex=1

P2 enters by P operation ---> mutex=0

This is the one case where 3 process are present in critical section

Related questions