In this section of Operating System Process Synchronization.it contain Operating System Process Synchronization – Peterson’s Solution 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. Peterson’s solution is restricted to ___ processes that alternate execution between their critical sections and remainder sections
- One
- Three
- Two
- All of the above
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
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.
- 1 and 3
- 2 and 4
- 3 and 4
- 1 and 4
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
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
Spinlocks do have an advantage, however, in that no context switch is required when a process must wait on a lock, and a context switch may take considerable time. Thus, when locks are expected to be held for short times, spinlocks are useful. They are often employed on multiprocessor systems where one thread can “spin” on one processor while another thread performs its critical section on another processor
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()
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
The implementation of a semaphore with a waiting queue may result in a situation where two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes. The event in question is the execution of a signal() operation. When such a state is reached, these processes are said to be deadlocked.
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)
- MutexLocks
- deadlocks
- spinlocks
- None of the above
indefinite blocking or starvation is a situation in which processes wait indefinitely within the semaphore. Indefinite blocking may occur if we remove processes from the list associated with a semaphore in LIFO (last-in, first-out) order.
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
Priority inversion can be more than a scheduling inconvenience. On systems with tight time constraints—such as real-time systems—priority inversion can cause a process to take longer than it should to accomplish a task. When that happens, other failures can cascade, resulting in system failure
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