search
HomeCommon ProblemWhat is the concept of deadlock?

What is the concept of deadlock?

Oct 15, 2021 am 11:50 AM
deadlock

Deadlock refers to a blocking phenomenon caused by two or more processes competing for resources or communicating with each other during execution. Without external force, they will not be able to advance. ; At this time, the system is said to be in a deadlock state or the system has produced a deadlock. These processes that are always waiting for each other are called deadlock processes.

What is the concept of deadlock?

The operating environment of this article: windows7 system, DELL G3 computer

What is the concept of deadlock?

Deadlock refers to a blocking phenomenon caused by two or more processes competing for resources or communicating with each other during execution. Without external force, they will all Unable to proceed. At this time, the system is said to be in a deadlock state or the system has a deadlock. These processes that are always waiting for each other are called deadlock processes.

Solution:

After a deadlock has occurred in the system, the occurrence of the deadlock should be detected in time and appropriate measures should be taken to relieve the deadlock.

Deadlock prevention.

This is a simpler and more intuitive method of prevention in advance. The method is to prevent deadlock by setting certain restrictions to destroy one or more of the four necessary conditions for deadlock. Preventing deadlock is an easier to implement method and has been widely used. However, because the constraints imposed are often too strict, system resource utilization and system throughput may be reduced.

Deadlock avoidance.

The system dynamically checks each resource request issued by the process that the system can satisfy, and decides whether to allocate resources based on the check results; if the system may deadlock after allocation, it will not be allocated, otherwise it will be allocated. This is a dynamic strategy to ensure that the system does not enter a deadlock state.

Deadlock detection and release.

Detect first: This method does not require any restrictive measures to be taken in advance, nor does it need to check whether the system has entered an unsafe zone. This method allows the system to deadlock during operation. However, the occurrence of deadlock can be detected in a timely manner through the detection mechanism set up in the system, and the processes and resources related to the deadlock can be accurately determined. Detection methods include timing detection, detection when efficiency is low, detection when the process is waiting, etc.

Then remove the deadlock: take appropriate measures to remove the deadlock that has occurred from the system.

This is a measure matching the detection of deadlock. When a deadlock is detected in the system, the process must be freed from the deadlock state. A common implementation method is to cancel or suspend some processes in order to reclaim some resources, and then allocate these resources to processes that are already in a blocked state to turn them into a ready state to continue running. Deadlock detection and relief measures may enable the system to achieve better resource utilization and throughput, but are also the most difficult to implement.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the concept of deadlock?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment