Operating System Questions and Answers – Classic Synchronization Problems

This set of 1000+ Operating System MCQs focuses on “The Classic Synchronization Problems”

1) The bounded buffer problem is also known as :
a) Readers – Writers problem
b) Dining – Philosophers problem
c) Producer – Consumer problem
d) None of these
View Answer

Answer: c
Explanation: None.

2) In the bounded buffer problem, there are the empty and full semaphores that :
a) count the number of empty and full buffers
b) count the number of empty and full memory spaces
c) count the number of empty and full queues
d) None of these
View Answer

Answer: a
Explanation: None.

3) In the bounded buffer problem :
a) there is only one buffer
b) there are n buffers ( n being greater than one but finite)
c) there are infinite buffers
d) the buffer size is bounded
View Answer

Answer: b
Explanation: None.

4) To ensure difficulties do not arise in the readers – writers problem, _______ are given exclusive access to the shared object.
a) readers
b) writers
c) None of these
View Answer

Answer: b
Explanation: None.

5) The dining – philosophers problem will occur in case of :
a) 5 philosophers and 5 chopsticks
b) 4 philosophers and 5 chopsticks
c) 3 philosophers and 5 chopsticks
d) 6 philosophers and 5 chopsticks
View Answer

Answer: a
Explanation: None.

6) A deadlock free solution to the dining philosophers problem :
a) necessarily eliminates the possibility of starvation
b) does not necessarily eliminate the possibility of starvation
c) eliminates any possibility of any kind of problem further
d) None of these
View Answer

Answer: b
Explanation: None.

7) 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.

i) Suppose a process executes in the following manner :
signal(mutex);
…..
critical section
…..
wait(mutex);

In this situation :
a) a deadlock will occur
b) processes will starve to enter critical section
c) several processes maybe executing in their critical section
d) All of these
View Answer

Answer: c
Explanation: None.

ii) Suppose a process executes in the following manner (replacing signal with wait) :
a) a deadlock will occur
b) processes will starve to enter critical section
c) several processes maybe executing in their critical section
d) All of these
View Answer

Answer: a
Explanation: None.

8) 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. (GATE 2010)

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 ?
a) Mutual exclusion but not progress
b) Progress but not mutual exclusion
c) Neither mutual exclusion nor progress
d) Both mutual exclusion and progress
View Answer

Answer: d
Explanation: None.

Sanfoundry Global Education & Learning Series – Operating System.

Subscribe Newsletter & Posts
About

Manish Bhojasia, a technology veteran with 17+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below.


Sanfoundry Training Center of Excellence (CoE)

Manish Bhojasia, a technology veteran with 17+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below.


1000 OS MCQs | Quiz

Basics
Processes
Process Control Block
Process Scheduling Queues
Process Synchronization
Process Creation
Inter Process Communication
Remote Procedure Calls
Structures
CPU Scheduling
CPU Scheduling Benefits
CPU Scheduling Algorithms - 1
CPU Scheduling Algorithms - 2
The Critical Section (CS) Problem and Solutions
Semaphores - 1
Semaphores - 2
Classic Synchronization Problems
Monitors
Atomic Transactions
Deadlock
Deadlock Prevention
Deadlock Avoidance
Deadlock Detection
Deadlock Recovery
Swapping Processes - 1
Swapping Processes - 2
Memory Management
Memory Allocation - 1
Memory Allocation - 2
Paging - 1
Paging - 2
Segmentation
I/O System - Application I/O Interface - 1
I/O System - Application I/O Interface - 2
I/O System - Kernel I/O Subsystems
RTOS
Real Time System - Implementing RT Operating Systems - 1
Real Time System - Implementing RT Operating Systems - 2
Real Time System - Real Time CPU Scheduling - 1
Real Time System - Real Time CPU Scheduling - 2
Multimedia Systems
Multimedia System - Compression - 1
Multimedia System - Compression - 2
Multimedia System - Compression - 3
Multimedia System - CPU and Disk Scheduling
Multimedia System - Network Management
Security - User Authentication
Security - Program and System Threats
Security - Securing Systems and Facilities
Security - Intrusion Detection
Security - Cryptography
Secondary Storage
Linux
Threads
User and Kernel Threads
Multi Threading Models
The fork and exec System Calls
Thread Cancellation
Signal Handling
Thread Pools
Virtual Memory
Demand Paging
Page Replacement Algorithms - 1
Page Replacement Algorithms - 2
Allocation of Frames
Thrashing
File System
File System Implementation
File System Interface Access Methods - 1
File System Interface Access Methods - 2
File System Interface Directory Structure - 1
File System Interface Directory Structure - 2
File System Interface Mounting and Sharing
File System Interface Protection
File System Implementation - Allocation Methods - 1
File System Implementation - Allocation Methods - 2
File System Implementation - Allocation Methods - 3
File System Implementation - Performance
File System Implementation - Recovery
File System Implementation - Network File System - 1
File System Implementation - Network File System - 2
I/O Subsystem
Disk Scheduling - 1
Disk Scheduling - 2
Disk Management
Swap Space Management
RAID Structure - 1
RAID Structure - 2
Tertiary Storage
Protection - Access Matrix
Protection
Security
Protection - Memory Protection
Protection - Revocation of Access Rights
Distributed Operating System
Distributed Operating System - Types & Resource Sharing
Distributed Operating System - Network Structure & Topology
Distributed Operating System - Robustness of Distributed Systems
Distributed File System - 1
Distributed File System - 2
Distributed File System - 3
Distributed Coordination
Distributed Synchornization
Follow Manish & Sanfoundry