Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of mysql deadlock

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Four basic ways to solve deadlocks

Deadlock prevention: by setting some restrictions, to break the necessary conditions for deadlock

2. Deadlock avoidance: In the process of resource allocation, some method is used to avoid the system from entering an unsafe state, thus avoiding deadlock.

3. Deadlock detection: deadlocks are allowed to occur, but after system detection, some measures are taken to clear deadlocks.

4. Deadlock resolution: This method is used in conjunction with deadlock detection.

Deadlock Introduction

Deadlock refers to a blocking phenomenon caused by two or more processes competing for resources or communicating with each other during execution. If there is no external force, they will not be able to advance. At this point, 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.

generation conditions

Although the process in the process of running, deadlocks may occur, but the occurrence of deadlocks must also have certain conditions, the occurrence of deadlocks must have the following four necessary conditions.

1) Mutual exclusion condition: refers to the exclusive use of allocated resources by a process, that is, a certain resource is occupied by only one process within a period of time. If there are other processes requesting resources at this time, the requester can only wait until the process that owns the resource is exhausted and released.

2) Request and hold conditions: refers to the process has maintained at least one resource, but made a new resource request, and the resource has been occupied by other processes, at this time the request process blocked, but it has obtained other resources to keep.

3) Non-deprivation conditions: refers to the process has obtained resources, before not used up, can not be deprived, can only be used up by their own release.

4) Loop waiting condition: When deadlock occurs, there must be a process-resource circular chain, that is, P0 in the process set {P0, P1, P2,···, Pn} is waiting for a resource occupied by P1;P1 is waiting for a resource occupied by P2,..., Pn is waiting for a resource occupied by P0.

The above is the 4 basic ways to solve deadlock details, more attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report