OS Process Synchronization Solved MCQs
In this section of Operating System Process Synchronization.it contain Operating System Process Synchronization – The Critical-Section Problem MCQs (Multiple Choice Questions Answers).All the MCQs (Multiple Choice Question Answers) requires in detail reading of Operating System subject as the hardness level of MCQs have been kept to advance level.
1.A Race condition refers to
- A situation where several processes access and manipulate the same data concurrently
- A situation where Single process access and manipulate the same data concurrently .
- A situation where No process access and manipulate the same data concurrently.
- None of the above
A. A situation where several processes access and manipulate the same data concurrently
2.Each process has a segment of code, called a ____________,in which the process may be changing common variables, updating a table, writing a file, and so on
- None-critical section
- Critical section
- Exit Section
- Entry Section
B. Critical section
3.In Critical section
- several processes access and manipulate the same data concurrently
- No process access and manipulate the same data concurrently
- when one process is executing in its critical section, no other process is allowed to execute in its critical section
- None of the above
C. when one process is executing in its critical section, no other process is allowed to execute in its critical section
4.A solution to the critical-section problem must satisfy which of the following three requirements:
I. Mutual exclusion
II. Progress
III. Un-Bounded waiting
IV. Bounded waiting
I. Mutual exclusion
II. Progress
III. Un-Bounded waiting
IV. Bounded waiting
- 1,2 ,3
- 2,3,4
- 1,3,4
- 1,2,4
D. 1,2,4
5.Which of the following condition stands true for Mutual Exclusion?
- No process access and manipulate the same data concurrently
- If process Pi is executing in its critical section, then no other processes can be executing in their critical sections
- several processes access and manipulate the same data concurrently
- None of above
B. If process Pi is executing in its critical section, then no other processes can be executing in their critical sections
6.Which of the following condition stands true for Progress?
- When a thread is executing in its critical section, no other threads can be executing in their critical sections.
- If no thread is executing in its critical section, and if there are some threads that wish to enter their critical Sections, then one of these threads will get into the critical section.
- several processes access and manipulate the same data in the critical section
- All of the above
B. If no thread is executing in its critical section, and if there are some threads that wish to enter their critical Sections, then one of these threads will get into the critical section.
7.Which of the following condition stands true for Bounded Waiting?
- When a thread is executing in its critical section, no other threads can be executing in their critical sections
- If no thread is executing in its critical section, and if there are some threads that wish to enter their critical sections, then one of these threads will get into the critical section.
- several processes access and manipulate the same data concurrently
- After a thread makes a request to enter its critical section, there is a bound on the number of times that other threads are allowed to enter their critical sections, before the request is granted
D. After a thread makes a request to enter its critical section, there is a bound on the number of times that other threads are allowed to enter their critical sections, before the request is granted
8.A preemptive kernel allows
- a process to be preempted while it is not running in kernel mode
- a process to be preempted while it is running in kernel mode
- a process to be preempted while it is running in User mode
- does not allow a process running in kernel mode to be preempted
B. a process to be preempted while it is running in kernel mode
9.nonpreemptive kernels
- a process to be preempted while it is not running in kernel mode
- a process to be preempted while it is running in kernel mode
- a process to be preempted while it is running in User mode
- does not allow a process running in kernel mode to be preempted
D. does not allow a process running in kernel mode to be preempted Explanation :
10.a nonpreemptive kernel is essentially free from race conditions
- True
- False
A. True Explanation :
11.a preemptive kernel is essentially free from race conditions
- True
- False
B. False Explanation :
1.Peterson’s solution is restricted to ___ processes that alternate execution between their critical sections and remainder sections
- One
- Three
- Two
- All of the above
C. Two
2.We use the mutex lock to protect critical regions and thus prevent race conditions.the term mutex is short for
- mutual exception
- mutual exclusion
- mutually explained
- mutual excluded
B. mutual exclusion
3.Select the correct statements regarding mutex lock to prevent race condition.
I. a process must acquire the lock before entering a critical section;
II. a process need not acquire the lock before entering a critical section;
III. it releases the lock when it exits the critical section
IV. a process must acquire the lock when it exits the critical section.
I. a process must acquire the lock before entering a critical section;
II. a process need not acquire the lock before entering a critical section;
III. it releases the lock when it exits the critical section
IV. a process must acquire the lock when it exits the critical section.
- 1 and 3
- 2 and 4
- 3 and 4
- 1 and 4
A. 1 and 3
4.The main disadvantage of the Mutex Lock is
- No waiting
- No waiting
- mutex locks can not be used to solve classical synchronization problems
- none of the above
B. No waiting
5.In Spinlocks :
- no context switch is required when a process must wait on a lock
- locks are expected to be held for short times
- employed on multiprocessor systems
- All of the mentioned
D. All of the mentioned Explanation :
6.A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations:
- exec() and exit()
- exec() and signal()
- wait() and exit()
- wait() and signal()
D. wait() and signal()
7.where two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes is called.
- MutexLocks
- deadlocked
- spinlocks
- None of the above
B. deadlocked Explanation :
8.Indefinite blocking may occur if we remove processes from the list associated with a semaphore in ________ order.
- LIFO (last-in, first-out)
- FIFO (Fisrst-in, first-out)
- LIFO and FIFO
- FILO (First in Last Out)
A. LIFO (last-in, first-out)
9.indefinite blocking or starvation is problem related to ___
- MutexLocks
- deadlocks
- spinlocks
- None of the above
B. deadlocks Explanation :
10.In Priority Inversion Which of following Stands TRUE:
- A scheduling challenge arises when a higher-priority process needs to read or modify kernel data that are currently being accessed by a lower-priority process
- Since kernel data are typically protected with a lock, the higher-priority process will have to wait for a lower-priority one to finish with the resource
- The situation becomes more complicated if the lower-priority process is preempted in favor of another process with a higher priority
- All of the above
D. All of the above Explanation :
11.a classic ______solution to the critical-section problem known as Peterson’s solution
- Hardware based
- software-based
- software and Hardware based
- None of the above
B. software-based
1.The bounded buffer problem is also known as :
- Producer – Consumer problem
- Readers – Writers problem
- Dining – Philosophers problem
- Dining – Readers problem
A. Producer – Consumer problem
2.In bounded buffer problem Which of the following Assumption Stands TRUE:
- I. We assume that the pool consists of n buffers, each capable of holding one item.
- II. The mutex semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to the value 1.
- III. The mutex semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to the value 0.
- IV. The empty and full semaphores count the number of empty and full buffers.The semaphore empty is initialized to the value n; the semaphore full is initialized to the value 0.
- V. The empty and full semaphores count the number of empty and full buffers.The semaphore empty is initialized to the value 0; the semaphore full is initialized to the value n.
- 1,3,5
- 1,2,4
- 1,2,5
- 3,4,5
B. 1,2,4 Explanation :
3.The readers–writers problem and its solutions have been generalized to provide reader–writer locks on some systems. When a process wishes only to read shared data, it requests the reader–writer lock in____
- Read MODE
- Read MODE
- Read and Write MODE
- All of the above
A. Read MODE
4.The readers–writers problem and its solutions have been generalized to provide reader–writer locks on some systems. A process wishing to modify the shared data must request the lock in____
- Read MODE
- Write MODE
- Read and Write MODE
- All of the above
B. Write MODE
5.Multiple processes are permitted to concurrently acquire a reader–writer lock in read mode, but only one process may acquire the lock for ___, as exclusive access is required for ____
- reading ,readers
- reading,writers
- Writing ,Writers
- None of the above
C. Writing ,Writers
6.The Dining-Philosophers Problem Solution is:
- Deadlock free solution
- Starvation free solution
- page fault free solution
- All of the above
A. Deadlock free solution
7.All processes share a semaphore variable mutex, which is initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward. Suppose that a process interchanges the order in which the wait() and signal() operations on the semaphore mutex are executed, resulting in the following execution: signal(mutex); ... critical section ... wait(mutex); In this situation
- a deadlock will occur
- processes will starve to enter critical section
- several processes maybe executing in their critical section
- all of the mentioned
C. several processes maybe executing in their critical section
8.All processes share a semaphore variable mutex, which is initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward. Suppose that a process replaces signal(mutex) with wait(mutex). That is, it executes wait(mutex); ... critical section ... wait(mutex); In this Case
- a deadlock will occur
- processes will starve to enter critical section
- several processes maybe executing in their critical section
- a deadlock will not occur
A. a deadlock will occur
9.in the following execution: signal(mutex); ... critical section ... wait(mutex); Suppose that a process omits the wait(mutex), or the signal(mutex), or both. In this case:
- processes will starve to enter critical section
- several processes maybe executing in their critical section
- either mutual exclusion is violated or a deadlock will occur.
- processes will not starve to enter critical section
C. either mutual exclusion is violated or a deadlock will occur.
Post a Comment