---
title: "What is Deadlock and what are its four necessary conditions in OS?"  
description: "What is Deadlock and what are its four necessary conditions in OS?"  
author: "Revati S Misra"  
published: 2023-03-26  
updated: 2023-04-02  
canonical: https://www.mindstick.com/forum/157585/what-is-deadlock-and-what-are-its-four-necessary-conditions-in-os  
category: "Operating System"  
tags: ["windows", "operating system"]  
reading_time: 2 minutes  

---

# What is Deadlock and what are its four necessary conditions in OS?

What is [deadlock](https://www.mindstick.com/forum/159421/a-database-update-operation-consistently-throws-a-deadlock-error)? [Explain](https://www.mindstick.com/forum/157854/what-is-system-debugging-explain-some-system-debugging-tools-used-in-modern-computer-systems) its four necessary [conditions](https://www.mindstick.com/blog/394/javascript-if-else) in OS.

## Replies

### Reply by Krishnapriya Rajeev

Deadlock is a situation that can occur in a multi-process system where two or more processes are blocked, *waiting for each other to release the resources* they hold, resulting in a standstill of the system. In other words, a deadlock is a state where a group of processes is all blocked and none of them can proceed.

For a deadlock to occur, four necessary conditions must be satisfied *simultaneously*. These conditions are as follows:

1. **Mutual Exclusion**: A resource must be accessible to only one process at a time, that is, at least one resource must be held in a *non-shareable mode*.
2. **Hold and Wait**: A process holding at least one resource is waiting to acquire additional resources held by other processes.
3. **No Preemption**: A resource cannot be forcibly removed from a process holding it, only the process itself can release the resource voluntarily.
4. **Circular Wait**: A set of processes is waiting for resources in a circular chain where the resource required by one process is with the process next to it. The resource required by the last process is held by the first process.

If all of these conditions are satisfied, then a deadlock will occur. Breaking any one of these conditions can prevent a deadlock from occurring.


---

Original Source: https://www.mindstick.com/forum/157585/what-is-deadlock-and-what-are-its-four-necessary-conditions-in-os

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
