Each Process Pᵢ, i = 1......9 is coded as follows repeat P(mutex) {Critical…
1997
Each Process Pᵢ, i = 1......9 is coded as follows
repeat
P(mutex)
{Critical section}
V(mutex)
foreverThe code for P₁₀ is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can be inside the critical section at any moment?
Answer: D. None of above — The semaphore mutex is initialized to 1, allowing one process to enter the critical section at a time under normal conditions. However, Process P₁₀ is unique…
- A.
1
- B.
2
- C.
3
- D.
None of above
Attempted by 175 students.
Show answer & explanation
Correct answer: D
The semaphore mutex is initialized to 1, allowing one process to enter the critical section at a time under normal conditions. However, Process P₁₀ is unique because it executes V(mutex) before attempting to enter its critical section. This initial V operation increments the semaphore value from 1 to 2, effectively creating two available slots for entry. Consequently, P₁₀ can enter the critical section while simultaneously allowing two other processes (e.g., P₁ and P₂) to execute their P(mutex) operations successfully.Since the semaphore count can be increased by the P10 .Hence each time P10 enters the critical section it can bring 2 more process in to the critical section. Hence all of them can be inside the critical section. Hence None of them is correct.
A video solution is available for this question — log in and enroll to watch it.
Explore the full course: Iocl Engineers Officers Grade A Paper 2