ESET Online Help

Search English
Select the topic

Deadlock

A deadlock is when each computer waits for a resource assigned to another process. In this situation, the processes are only executed if the resource required is held by another process waiting for another resource to be released. It is important to prevent a deadlock before it can occur. The resource scheduler can detect a deadlock occurrence, which helps the operating system keep track of all the resources allocated to different processes. Deadlock can occur if the following four conditions hold simultaneously:

No preemptive actionA resource can be released only voluntarily by the process holding it after that process has finished its task.

Mutual exclusion—A special type of binary semaphore used to control access to the shared resource. It enables current higher-priority tasks to be kept blocked for the shortest time possible.

Hold and wait—In this condition, processes must be stopped from holding single or multiple resources while simultaneously waiting for one or more others.

Circular wait—It imposes a total ordering of all resource types. Circular wait also requires that every process requests resources in increasing order of enumeration.

 

There are three ways to handle a deadlock:

Do not let the system get into a deadlock state.

Let the deadlock occur, then do preemption to handle it when occurred.

If a deadlock occurs, restart the system.