AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Easydeadlockos

~60s

The four deadlock conditions

Which of these is not one of the four necessary conditions for deadlock?

Show the answer and the worked solution

Correct answer: D.

Priority inversion

Worked solution

  1. The four conditions that must hold simultaneously are mutual exclusion, hold and wait, no preemption and circular wait.
  2. Break any one of them and deadlock becomes impossible, which is exactly how prevention schemes are designed.
  3. Priority inversion describes a high-priority task delayed by a lower-priority one holding a lock; it degrades response time but is not a deadlock condition.

Answer: Priority inversion.

The idea

Deadlock needs all four conditions at once. Coffman's list is worth memorising in order, because prevention questions always ask which condition a given rule attacks.

Shortcut. Coffman's four are mutual exclusion, hold and wait, no preemption and circular wait; priority inversion is a scheduling problem outside that list.

Common trap. "Mutual exclusion" sounds like a safeguard rather than a cause, so candidates strike it out, but deadlock is impossible on shareable resources, which makes it the first of the four.

The four deadlock conditions — Aptitude Question

The four deadlock conditions: Which of these is not one of the four necessary conditions for deadlock? Answer and worked solution on CodeKairo.

Question

Which of these is not one of the four necessary conditions for deadlock?

Options

  1. Circular wait
  2. Hold and wait
  3. Mutual exclusion
  4. Priority inversion
Show the answer and the worked solution

Correct answer: D. Priority inversion

Worked solution

  1. The four conditions that must hold simultaneously are mutual exclusion, hold and wait, no preemption and circular wait.
  2. Break any one of them and deadlock becomes impossible, which is exactly how prevention schemes are designed.
  3. Priority inversion describes a high-priority task delayed by a lower-priority one holding a lock; it degrades response time but is not a deadlock condition.

Answer: Priority inversion.

The idea

Deadlock needs all four conditions at once. Coffman's list is worth memorising in order, because prevention questions always ask which condition a given rule attacks.

Shortcut. Coffman's four are mutual exclusion, hold and wait, no preemption and circular wait; priority inversion is a scheduling problem outside that list.

Common trap. "Mutual exclusion" sounds like a safeguard rather than a cause, so candidates strike it out, but deadlock is impossible on shareable resources, which makes it the first of the four.

All OS, DBMS & Networks questions · placement mock tests