131k views
5 votes
All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward.

i) Suppose a process executes in the following manner :
signal(mutex);
.....
critical section
.....
wait(mutex);

In this situation :
a) a deadlock will occur
b) processes will starve to enter critical section
c) several processes maybe executing in their critical section
d) All of these

User Snaut
by
7.8k points

1 Answer

0 votes

Final answer:

In the given situation, several processes may be executing in their critical section at the same time.

Step-by-step explanation:

In the given situation, when a process executes signal(mutex), it releases the semaphore variable 'mutex', allowing other processes to execute their wait(mutex) statement and enter the critical section. After executing the critical section, the process then executes wait(mutex), which blocks the process until the semaphore variable is available again.

Therefore, in this situation, several processes may be executing in their critical section at the same time, as the semaphore variable 'mutex' is released after the signal(mutex) statement.

User Jozzy
by
8.4k points