Process-Synchronization

Question 1
Semaphores
A
synchronize critical resources to prevent deadlock
B
synchronize critical resources to prevent contention
C
are used to do I/O
D
are used for memory management
       Operating-Systems       Process-Synchronization       ISRO-2007
Question 1 Explanation: 
Semaphore is a variable and is used to solve critical section problem and to achieve process synchronization in the multi processing environment.
Question 2
Mutual exclusion problem occurs
A
Between two disjoint processes that do not interact
B
Among processes that share resources
C
Among processes that do not use the same resource
D
Between two processes that uses different resources of different machine
       Operating-Systems       Process-Synchronization       ISRO-2017 May
Question 2 Explanation: 
→ Mutual exclusion is used to avoid the concurrent use of the same resources. But sometimes the problem occurred in mutual exclusion when process or program is not sharing the same resources.
Question 3
A critical region
A
is a piece of code which only one process executes at a time
B
is a region prone to deadlock
C
is a piece of code which only a finite number of processes execute
D
is found only in Windows NT operating system
       Operating-Systems       Process-Synchronization       ISRO-2017 May
Question 3 Explanation: 
A critical region is a piece of code which only one process executes at a time. It cannot be executed by more than one process at a time.
Question 4
At a particular time, the value of a counting semaphore is 10, it will become 7 after: (a) 3 V operations (b) 3 P operations (c) 5 V operations and 2 P operations (d) 2 V operations and 5 P operations Which of the following option is correct?
A
Only (b)
B
Only(d)
C
Both (b) and (d)
D
None of these
       Operating-Systems       Process-Synchronization       ISRO-2017 May
Question 4 Explanation: 
P: Wait operation decrements the value of the counting semaphore by 1.
V: Signal operation increments the value of counting semaphore by 1.

Current value of the counting semaphore = 10
a) after 3 P operations, value of semaphore = 10-3 = 7
d) after 2 v operations, and 5 operations value of semaphore = 10 + 2 – 5 = 7
Question 5
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will be
A
18
B
22
C
15
D
13
       Operating-Systems       Process-Synchronization       ISRO-2016
Question 5 Explanation: 
Here, 20P operations means 20 wait operations. It decrement value by 1 every time.
xV operations means x increments operations. It increment value by 1 every time.
→ New value of semaphore is 5 after performing xV operations
= -13 + xV
= 5
xV = 5 + 13
= 18
→ After applying 20P operations in semaphore value is = 7-20 = -13
Question 6
Which of the following statements about semaphores is true?
A
P and V operations should be indivisible operations
B
A semaphore implementation should guarantee that threads do not suffer indefinite postponement
C
If several threads attempt a P(S) operation simultaneously, only one thread should be allowed to proceed.
D
All of the above
       Operating-Systems       Process-Synchronization       Nielit Scientist-B IT 4-12-2016
Question 6 Explanation: 
● A semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system
● Semaphores are a useful tool in the prevention of race conditions; however, their use is by no means a guarantee that a program is free from these problems.
● Semaphores which allow an arbitrary resource count are called counting semaphores, while semaphores which are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores and are used to implement locks.
Question 7
Which of the following conditions must be met to avoid race around problem?
A
△t < t​ p​ < T
B
T > △t > t​ p
C
2t​ p​ < △t < T
D
none of these
       Operating-Systems       Process-Synchronization       Nielit Scientist-C 2016 march
Question 7 Explanation: 
When we are using T > △t > tp this condition, we will avoid race around condition.
Question 8
Semaphores are used to solve the problem of
I. Race Condition
II. Process Synchronization
III. Mutual Exclusion
IV. None of the above
A
I and II
B
II and III
C
All of the above
D
None of the above
       Operating-Systems       Process-Synchronization       ISRO CS 2015
Question 8 Explanation: 
Semaphore are used to solve the problem of process synchronization and mutual exclusion.
Semaphore are 2 types.
Counting semaphore
Binary semaphore
Question 9
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and 15 V operations were completed on this semaphore. The resulting value of the semaphore is :
A
42
B
2
C
7
D
12
       Operating-Systems       Process-Synchronization       ISRO CS 2015
Question 9 Explanation: 
Counting semaphore value is 7
After 20 P operations value of semaphore = 7 – 20 = -13
After 15 V operations value of semaphore = -13 + 15 = 2
Question 10
The producer and consumer processes share the following variables:
int n;
Semaphore M=1
Semaphore E=n
Semaphore F=0
The consumer process must execute ______ and before removing an item from buffer.
A
signal(M), signal(F)
B
signal(M), wait(F)
C
Signal(F), wait(M)
D
wait(F), wait(M)
       Operating-Systems       Process-Synchronization       KVS 22-12-2018 Part-B
Question 10 Explanation: 
F is given 0 then no items would be produced
→ Two standard operations, wait and signal are defined on the semaphore.
→ Entry to the critical section is controlled by the wait operation and exit from a critical region is taken care by signal operation.
→ The manipulation of semaphore (S) takes place as following:
→ The wait command P(S) decrements the semaphore value by 1. If the resulting value becomes negative then P command is delayed until the condition is satisfied.
→ The V(S) i.e. signals operation increments the semaphore value by 1.
→ The wait, signal operations are also called P and V operations.
Question 11
_____ is a sequence of memory read-write operations that are atomic
A
Critical section object
B
Adaptive mutex
C
Turnstile
D
Memory transaction
       Operating-Systems       Process-Synchronization       KVS DEC-2013
Question 11 Explanation: 
An operation (or set of operations) is atomic or uninterruptible if it appears to the rest of the system to occur instantaneously.
Question 12
A classic software based solution to the critical section problem is known as
A
Peterson’s solution
B
Process synchronization
C
Coordination
D
Race Condition
       Operating-Systems       Process-Synchronization       KVS DEC-2013
Question 12 Explanation: 
Peterson's solution is a concurrent programming algorithm for mutual exclusion that allows two or more processes to share a single-use resource without conflict, using only shared memory for communication
Question 13

____ is an IEEE 1003.1C standard API for thread creation and synchronization in operating system.

A
Mac OS X
B
Solaris
C
POSIX
D
Kernel
       Operating-Systems       Process-Synchronization       JT(IT) 2016 PART-B Computer Science
Question 13 Explanation: 
POSIX Threads, usually referred to as pthreads, is an execution model that exists independently from a language, as well as a parallel execution model. It allows a program to control multiple different flows of work that overlap in time. Each flow of work is referred to as a thread, and creation and control over these flows is achieved by making calls to the POSIX Threads API. POSIX Threads is an API defined by the standard POSIX.1c, Threads extensions (IEEE Std 1003.1c-1995).
Question 14
Semaphores are used to solve the problem of
A
mutual exclusion
B
race condition
C
Process synchronization
D
The belady problem
       Operating-Systems       Process-Synchronization       KVS DEC-2017
Question 14 Explanation: 
Semaphores are used to solve the problem of process synchronization. There are two types of semaphores
1. Counting Semaphore
2. Binary semaphore
Question 15
Consider a pair of producer consumer process, sharing the following variables:
int n;
Semaphore M=1;
Semaphore E=n; /*size of buffer*/
Semaphore F=0;
The consumer process must execute ____ and _____ after removing an item from the buffer.
A
wait(M), signal(E)
B
signal(E),signal(M)
C
signal(M),signal(E)
D
signal(E),wait(M)
       Operating-Systems       Process-Synchronization       KVS 30-12-2018 Part B
Question 15 Explanation: 
→Two standard operations, wait and signal are defined on the semaphore.
→Entry to the critical section is controlled by the wait operation and exit from a critical region is taken care by signal operation.
→The manipulation of semaphore (S) takes place as following:
→The wait command P(S) decrements the semaphore value by 1. If the resulting value becomes negative then P command is delayed until the condition is satisfied.
→The V(S) i.e. signals operation increments the semaphore value by 1.
→The wait, signal operations are also called P and V operations.
Question 16
There are three processes P​ 1​ , P​ 2​ and P​ 3​ sharing a semaphore for synchronizing a variable. Initial value of semaphore is one. Assume that negative value of semaphore tells us how many processes are waiting in queue. Processes access the semaphore in following order :
(a) P​ 2​ needs to access
(b) P​ 1​ needs to access
(c) P​ 3​ needs to access
(d) P​ 2​ exits critical section
(e) P​ 1​ exits critical section
The final value of semaphore will be :
A
0
B
1
C
-1
D
-2
       Operating-Systems       Process-Synchronization       UGC NET CS 2017 Jan -paper-2
Question 16 Explanation: 
There are 3 processes P​ 1​ , P​ 2​ and P​ 3​ . Given, Initial value of semaphore S is 1.
Step-1: P​ 2​ needs to access, we are allocating critical section to P​ 2​ . S value become 0.
Step-2: P​ 1​ needs to access but processor not available. So, S value become -1. Step-3: P​ 3​ needs to access but processor not available. So, S value become -2. Step-4: P​ 2​ exits critical section. So, we are allocating processor to P​ 1​ then S value is -1. Step-5: P​ 1​ exits critical section. So, we are allocating processor to P​ 3​ then S value is 0.
Question 17
Let P​ i​ and P​ j​ be two processes, R be the set of variables read from memory, and W be the set of variables written to memory. For the concurrent execution of two processes P​ i​ and P​ j​ which of the following conditions is not true?
A
R(P​ i​ ) ∩ W(P​ j​ ) = Ф
B
W(P​ i​ ) ∩ R(P​ j​ ) = Ф
C
R(P​ i​ ) ∩ R(P​ j​ ) = Ф
D
W(P​ i​ ) ∩ W(P​ j​ ) = Ф
       Operating-Systems       Process-Synchronization       UGC NET CS 2015 Jun- paper-2
Question 17 Explanation: 
Option-A: It performs Read and Write. So, it violates concurrent execution of two processes Pi and Pj
Option-B: It performs write and Read. So, it violates concurrent execution of two processes Pi and Pj
Option-C: It performs Read and Write. So, it is not violates concurrent execution of two processes Pi and Pj
Option-D: It performs Write and Write. So, it violates concurrent execution of two processes Pi and Pj
Question 18
Semaphores are used to :
A
Synchronise critical resources to prevent deadlock
B
Synchronise critical resources to prevent contention
C
Do I/o
D
Facilitate memory management
       Operating-Systems       Process-Synchronization       UGC NET CS 2004 Dec-Paper-2
Question 18 Explanation: 
→ Semaphores are implemented to prevent deadlocks using wait and signal operation.
→ A semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system.
→ A semaphore is simply a variable. This variable is used to solve critical section problems and to achieve process synchronization in the multi processing environment.
Question 19
Producer consumer problem can be solved using :
A
semaphores
B
event counters
C
monitors
D
all the above
       Operating-Systems       Process-Synchronization       UGC NET CS 2005 Dec-Paper-2
Question 19 Explanation: 
→ Producer consumer problem can be solved using semaphores.
→ A semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system. Semaphore basically two types.
1. Counting semaphores
2. Binary semaphores
Question 20
A relationship between processes such that each has some part (critical section) which must not be executed while the critical section of another is being executed, is known as
A
Semaphore
B
Mutual exclusion
C
Multiprogramming
D
Message passing
       Operating-Systems       Process-Synchronization       UGC NET CS 2011 June-Paper-2
Question 20 Explanation: 
A relationship between processes such that each has some part (critical section) which must not be executed while the critical section of another is being executed, is known as Mutual exclusion.
Question 21
Concurrent processes are processes that
A
do not overlap in time
B
overlap in time
C
are executed by a processor at the same time
D
none of the above
       Operating-Systems       Process-Synchronization       NIELIT Technical Assistant_2016_march
Question 22
Consider a system with five processes P0 through P4 and three resource types A, B and C. Resource type A has seven instances, resource type B has two instances and resource type C has six instances suppose at time T0we have the following allocation.

If we implement Deadlock detection algorithm we claim that system is ____________.
(1) Semaphore
(2) Deadlock state
(3) Circular wait
(4) Not in deadlock state
A
(1), (2) and (3)
B
(1) and (3)
C
(3) and (4)
D
All are correct.
       Operating-Systems       Process-Synchronization       UGC NET CS 2017 Nov- paper-3
Question 22 Explanation: 


Question 23
The Bounded buffer problem is also known as __________.
A
Producer - consumer problem
B
Reader - writer problem
C
Dining Philosophers problem
D
Both (2) and (3)
       Operating-Systems       Process-Synchronization       UGC NET CS 2017 Nov- paper-3
Question 23 Explanation: 
→ The Bounded buffer problem is also known as producer-consumer problem.
→ The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue.
→ The producer's job is to generate data, put it into the buffer, and start again. At the same time, the consumer is consuming the data (i.e., removing it from the buffer), one piece at a time.
→ The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer.
Question 24
In an operating system, indivisibility of operation means:
A
Operation is interruptible
B
Race - condition may occur
C
Processor can not be preempted
D
All of the above
       Operating-Systems       Process-Synchronization       UGC NET CS 2015 Dec - paper-3
Question 24 Explanation: 
Indivisibility of operation refers to the irreducibility of an operation i.e either an operation will be executed completely or it will not be executed.
So we can say that indivisibility of operation means Processor can not be preempted because a non-pre-empted operation is the one which is either not executed but if its execution starts then it can’t be interrupted until it executes completely.
There are 24 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com