My question is little different.
Each Process Pi, i = 1....9 is coded as follows
repeat
P(mutex)
{Critical section}
V(mutex)
forever
The code for P10 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?
If instead of mutex a semaphore would have been used, then was it possible that p1, p2 , p3 or any other process instead of process p10 could have opted out while all are in the critical section.?
My doubt started from the following note which I read from a source:
"Mutex can be released only by thread that had acquired it, while you can signal semaphore from any other thread (or process), so semaphores are more suitable for some synchronization problems like producer-consumer."