214k views
1 vote
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.

ii) Suppose a process executes in the following manner (replacing signal with wait) :
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

1 Answer

2 votes

Final answer:

Processes using the semaphore variable mutex can experience a deadlock, starvation, or successful execution in their critical sections.

Step-by-step explanation:

The subject of this question is computers and technology.

In this scenario, the semaphore variable mutex is used to control access to a critical section of code, ensuring that only one process can execute it at a time. Each process must call wait(mutex) before entering the critical section and signal(mutex) afterward.

Based on the given information, the correct answer is d) All of these:

  1. A deadlock can occur if multiple processes are waiting indefinitely for the mutex variable and none of them can proceed.
  2. Processes can starve to enter the critical section if they are continuously delayed by other processes acquiring the mutex before them.
  3. Several processes can be executing in their critical sections if they successfully acquire the mutex without being blocked by others.
User Matt Hyde
by
7.6k points