Deadlock Prevention - Operating System Questions and Answers

  • 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

Answer: Option 'C'

must not exceed the total number of resources available in the system

  • 2. The request and release of resources are ___________
   A.) command line statements
   B.) interrupts
   C.) system calls
   D.) special programs

Answer: Option 'C'

system calls

  • 3. Multithreaded programs are :
   A.) lesser prone to deadlocks
   B.) more prone to deadlocks
   C.) not at all prone to deadlocks
   D.) none of the mentioned

Answer: Option 'B'

more prone to deadlocks

  • 4. For a deadlock to arise, which of the following conditions must hold simultaneously?
   A.) Mutual exclusion
   B.) No preemption
   C.) Hold and wait
   D.) All of the mentioned

Answer: Option 'D'

All of the mentioned

  • 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 the mentioned

Answer: Option 'A'

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 the mentioned

Answer: Option 'B'

A process must be holding at least one resource and waiting to acquire additional resources that are being held by other processes

  • 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

Answer: Option 'A'

to ensure that at least one of the necessary conditions cannot hold

  • 8. For non sharable resources like a printer, mutual exclusion :
   A.) must exist
   B.) must not exist
   C.) may exist
   D.) none of the mentioned

Answer: Option 'A'

must exist

  • 9. For sharable resources, mutual exclusion :
   A.) is required
   B.) is not required
   C.) maybe or maynot be required
   D.) none of the mentioned

Answer: Option 'B'

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 the mentioned

Answer: Option '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 the mentioned

Answer: Option 'B'

Low resource utilization

  • 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

Answer: Option 'D'

then all resources currently being held are preempted

  • 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 the mentioned

Answer: Option 'A'

impose a total ordering of all resource types and to determine whether one precedes another in the ordering