Question
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)?
a.
1
b.
2
c.
3
d.
None of the mentioned
Posted under Operating System
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. 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)...
Similar Questions
Discover Related MCQs
Q. 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;
}
Here, w1 and w2 are shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct?
View solution
Q. The following pair of processes share a common variable X :
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
Process B
int Z;
B1: Z = X+1;
B2: X = Z;
X is set to 5 before either process begins execution. As usual, statements within a process are executed sequentially, but statements in process A may execute in any order with respect to statements in process B.
How many different values of X are possible after both processes finish executing ?
View solution
Q. The program follows to use a shared binary semaphore T :
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
signal(T);
Process B
int Z;
B1: wait(T);
B2: Z = X+1;
X = Z;
T is set to 0 before either process begins execution and, as before, X is set to 5.
Now, how many different values of X are possible after both processes finish executing ?
View solution
Q. 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 :
View solution
Q. 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 :
wait(mutex);
.....
critical section
.....
wait(mutex);
In this situation :
View solution
Q. Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.
Method used by P1 :
while(S1==S2);
Critical section
S1 = S2;
Method used by P2 :
while(S1!=S2);
Critical section
S2 = not(S1);
Which of the following statements describes properties achieved ?
View solution
Q. Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock ?
I) 2-phase locking
II) Time-stamp ordering
View solution
Q. The initial value of the semaphore that allows only one of the many processes to enter their critical sections, is
View solution
Q. For how many processes which are sharing common data, the Dekker's algorithm implements mutual exclusion?
View solution
Q. Semaphores
View solution
Q. What is the initial value of the semaphore to allow only one of the many processes to enter their critical section?
View solution
Q. Part of a program where the shared memory is accessed and which should be executed invisibly, is called
View solution
Q. A critical region is
View solution
Q. For procedure, the system prevent the overlap of buffer
View solution
Q. In implementation of Semaphores, for a single processor system, it is possible to inhibited
View solution
Q. In message passing a process receives information by executing the
View solution
Q. In a uniprocessor system concurrent processes cannot have overlapped
View solution
Q. In addressing, a many to one relationship is useful for
View solution
Q. The controller process services writes a
View solution
Q. Using Semaphores, each process has a critical section used to access the
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Operating System? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!