in Operating System
464 views
5 votes
5 votes

Each process $P_i$, where $i= 1$ to $9$ is coded as follows  

repeat 
 P (mutex)
   {critical section }
 V (mutex)
 forever 


The code for $P_{10}$ is identical except that it uses $V$ (mutex) instead of $P$ (mutex) and vice-verse. What is the largest number of processes that can be inside the critical section at any moment if initial value of the semaphore is 1? 

  1. 1
  2. 2
  3. 3
  4. none
in Operating System
by
464 views

2 Comments

the correct answer should be 10
–2
–2

@MiNiPanda

 
Here also repeat forever then why we cant use P10 more than one time ?
 
 
1
1

5 Answers

0 votes
0 votes

$P_1$ enters CS; preempt. mutex = 0 now.

$P_{10}$ enters CS; preempt. mutex = 1 now.

$P_2$ enters CS. mutex = 0 again.

That's it.

Option C

Answer:

Related questions