当前位置:网站首页>Conditions and solutions of deadlock
Conditions and solutions of deadlock
2022-07-02 15:54:00 【lvhui321】
Multiple threads competing for resources wait for each other , The phenomenon that causes permanent blocking is called deadlock
Conditions for Deadlock
1. Mutual exclusivity : Shared resources can only be occupied by one thread
2. To possess and wait for : Threads T Shared resources have been obtained A, Waiting to share resources B Not released when A
3. Do not take : Other threads cannot forcibly occupy T Resources in possession
4. Cycle and wait : Threads T1 Wait for thread T2 Resources in possession , Threads T2 Wait for thread T1 Resources in possession
Crack deadlock
There are three conditions except mutex for the condition of breaking deadlock , as follows :
1. damage “ Occupy and wait ” Conditions , You can apply for all resources at once , So there is no waiting .
2. damage “ Do not take ” Conditions , When a thread occupying some resources further requests other resources , If the application does not arrive , Can actively release the resources it occupies , In this way, we can't seize this condition and destroy .
3. damage “ Loop waiting for ” Conditions , It can be prevented by applying resources in sequence . The so-called sequential application , Resources are in linear order
Of , When applying, you can first apply for a resource with a small serial number , And then apply for a large number of resources , In this way, after linearization, there will be no cycle
了 .
边栏推荐
- /bin/ld: 找不到 -lcrypto
- Pyobject to char* (string)
- 处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
- Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
- How to use percona tool to add fields to MySQL table after interruption
- What are the necessary functions of short video app development?
- idea 公共方法抽取快捷键
- PHP static members
- 【Salesforce】如何确认你的Salesforce版本?
- The sea of stars hidden behind the nebula graph
猜你喜欢

中科大脑知识图谱平台建设及业务实践

蚂蚁集团大规模图计算系统TuGraph通过国家级评测

Introduction to dynamic planning I, BFS of queue (70.121.279.200)

【5G NR】RRC连接释放

全是精华的模电专题复习资料:基本放大电路知识点

Aike AI frontier promotion (7.2)

【Salesforce】如何确认你的Salesforce版本?

Introduction to Dynamic Planning II (5.647.62)

愛可可AI前沿推介(7.2)
![[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)](/img/26/3f19d36c048e669c736e27384e0fa7.jpg)
[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)
随机推荐
Application of visualization technology in Nebula graph
Moveit obstacle avoidance path planning demo
Jsp+mysql006 community management system
For the problem that Folium map cannot be displayed, the temporary solution is as follows
2279. Maximum number of backpacks filled with stones
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
/Bin/ld: cannot find -lcrypto
[salesforce] how to confirm your salesforce version?
Boot 中bean配置覆盖
The outline dimension function application of small motherboard
6095. Strong password checker II
Group by的用法
Postgressql stream replication active / standby switchover primary database no read / write downtime scenario
死锁的条件及解决方法
Deux séquences ergodiques connues pour construire des arbres binaires
GraphX 图计算实践之模式匹配抽取特定子图
win10系统升级一段时间后,内存占用过高
中科大脑知识图谱平台建设及业务实践
PyObject 转 char* (string)