Operating System Questions and Answers – Deadlock Prevention

This set of 1000+ Operating System MCQs focuses on “Deadlock Prevention”

1) The number of resources requested by a process :
a) must always be less than the total number of resources available in the system
b) must always be equal to the total number of resources available in the system
c) must not exceed the total number of resources available in the system
d) must exceed the total number of resources available in the system
View Answer

Answer: c
Explanation: None.

2) The request and release of resources are ___________.
a) command line statements
b) interrupts
c) system calls
d) special programs
View Answer

Answer: c
Explanation: None.

3) Multithreaded programs are :
a) lesser prone to deadlocks
b) more prone to deadlocks
c) not at all prone to deadlocks
d) None of these
View Answer

Answer: b
Explanation: Multiple threads can compete for shared resources.

4) For a deadlock to arise, which of the following conditions must hold simultaneously ? ( choose all that apply )
a) Mutual exclusion
b) Starvation
c) Hold and wait
d) No preemption
e) Circular wait
View Answer

Answer: a, c, d and e
Explanation: None.

5) For Mutual exclusion to prevail in the system :
a) at least one resource must be held in a non sharable mode
b) the processor must be a uniprocessor rather than a multiprocessor
c) there must be at least one resource in a sharable mode
d) All of these
View Answer

Answer: a
Explanation: If another process requests that resource (non – shareable resource), the requesting process must be delayed until the resource has been released.

6) For a Hold and wait condition to prevail :
a) A process must be not be holding a resource, but waiting for one to be freed, and then request to acquire it
b) A process must be holding at least one resource and waiting to acquire additional resources that are being held by other processes
c) A process must hold at least one resource and not be waiting to acquire additional resources
d) None of these
View Answer

Answer: b
Explanation: None.

7) Deadlock prevention is a set of methods :
a) to ensure that at least one of the necessary conditions cannot hold
b) to ensure that all of the necessary conditions do not hold
c) to decide if the requested resources for a process have to be given or not
d) to recover from a deadlock
View Answer

Answer: a
Explanation: None.

8) For non sharable resources like a printer, mutual exclusion :
a) must exist
b) must not exist
c) may exist
d) None of these
View Answer

Answer: a
Explanation: A printer cannot be simultaneously shared by several processes.

9) For sharable resources, mutual exclusion :
a) is required
b) is not required
c) None of these
View Answer

Answer: b
Explanation: They do not require mutually exclusive access, and hence cannot be involved in a deadlock.

10) To ensure that the hold and wait condition never occurs in the system, it must be ensured that :
a) whenever a resource is requested by a process, it is not holding any other resources
b) each process must request and be allocated all its resources before it begins its execution
c) a process can request resources only when it has none
d) All of these
View Answer

Answer: d
Explanation: c – A process may request some resources and use them. Before it can can request any additional resources, however it must release all the resources that it is currently allocated.

11) The disadvantage of a process being allocated all its resources before beginning its execution is :
a) Low CPU utilization
b) Low resource utilization
c) Very high resource utilization
d) None of these
View Answer

Answer: b
Explanation: None.

12) To ensure no preemption, if a process is holding some resources and requests another resource that cannot be immediately allocated to it :
a) then the process waits for the resources be allocated to it
b) the process keeps sending requests until the resource is allocated to it
c) the process resumes execution without the resource being allocated to it
d) then all resources currently being held are preempted
View Answer

Answer: d
Explanation: None.

13) One way to ensure that the circular wait condition never holds is to :
a) impose a total ordering of all resource types and to determine whether one precedes another in the ordering
b) to never let a process acquire resources that are held by other processes
c) to let a process wait for only one resource at a time
d) All of these
View Answer

Answer: a
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