All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the ...
View Question
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.
Suppose a process executes in the following manner.
signal(mutex);
…..
critical section
…..
wait(mutex);
In this situation :
All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the ...
View QuestionA deadlock free solution to the dining philosophers problem ____________
a) necessarily eliminates the possibility of starvation b) does not necessarily eliminate the possibility of starvation c) eliminates any ...
View QuestionThe dining – philosophers problem will occur in case of ____________
a) 5 philosophers and 5 chopsticks b) 4 philosophers and 5 chopsticks c) 3 philosophers ...
View QuestionTo ensure difficulties do not arise in the readers – writers problem _______ are given exclusive access to the shared object.
a) readers b) writers c) readers and writers d) none of the mentioned Answer: b Explanation: writers
View QuestionIn the bounded buffer problem ____________
a) there is only one buffer b) there are n buffers ( n being greater than one but ...
View QuestionIn the bounded buffer problem, there are the empty and full semaphores that ___________
a) count the number of empty and full buffers b) count the number of empty and full memory ...
View QuestionThe bounded buffer problem is also known as ____________
a) Readers – Writers problem b) Dining – Philosophers problem c) Producer – Consumer problem d) none of the mentioned
View Question
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes.
Process P1 :
while(true)
{
w1 = true;
while(w2 == true);
Critical section
w1 = false;
}
Remainder Section
Process P2 :
while(true)
{
w2 = true;
while(w1 == true);
Critical section
w2 = false;
}
Remainder Section
Here, w1 and w2 have shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct?.
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct ...
View Question
Each process Pi, i = 0,1,2,3,……,9 is coded as follows.
repeat
P(mutex)
{Critical Section}
V(mutex)
forever
The code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is the largest number of processes that can be inside the critical section at any moment (the mutex being initialized to 1)?
Each process Pi, i = 0,1,2,3,……,9 is coded as follows. repeat P(mutex) {Critical Section} V(mutex)
View Question