adplus-dvertising

Welcome to the Process Synchronization MCQs Page

Dive deep into the fascinating world of Process Synchronization with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Process Synchronization, a crucial aspect of Operating System. In this section, you will encounter a diverse range of MCQs that cover various aspects of Process Synchronization, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Operating System.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Process Synchronization. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Operating System.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Process Synchronization. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Process Synchronization MCQs | Page 11 of 15

Discuss
Answer: (a).growing & shrinking phase
Discuss
Answer: (a).A transaction may obtain locks, but does not release any
Discuss
Answer: (c).A transaction may release locks, but does not obtain any new locks
Q104.
The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.

Process P0
while(true)
{
wait(S0);
print '0';
release(S1);
release(S2);
}

Process P1
wait(S1);
release(S0);

Process P2
wait(S2);
release(S0);

How many times will P0 print ‘0’ ?
Discuss
Answer: (a).At least twice
Q105.
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)?
Discuss
Answer: (c).3
Q106.
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?
Discuss
Answer: (d).It does not prevent deadlocks, but ensures mutual exclusion
Q107.
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 ?
Discuss
Answer: (c).four
Q108.
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 ?
Discuss
Answer: (a).one
Q109.
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 :
Discuss
Answer: (c).several processes maybe executing in their critical section
Q110.
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 :
Discuss
Answer: (a).a deadlock will occur

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!