A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does.
A program probably causes deadlock between two threads that are both trying to acquire locks for the same two resources.
To avoid this sort of deadlock when locking multiple resources, all threads should always acquire their locks in the same order.
Thread 1 locked resource1, and won't release it 'till it gets a lock on
resource2. This thread2 holds the lock on resource2, and won't
release it 'till it gets resource1. We're at an impasse. Neither thread can run, and the program freezes up.
分享到:
相关推荐
牛津小学英语 1BUnit 7 What’s that?Story time 课件+音视频
高中What's really green?课件设计.pptx
What’s Spring?What’s SprinWhat’s Spring?g?
接力版四年级下册小学英语 Lesson 5 What are you doing?说课稿.doc
本汇编程序显示what's your name?并输入你的名字,要不要循环
What's Linux?.pdf
牛津小学英语 1BUnit 5 What’s this?Story time课件.zip
Unit 8 What’s Your Dream课时练习题及答案3.doc
what time is it?
What we are now and what we will be
What are Digital Humans? 什么是数字人?.pdf
What bugs in the cloud?A Study of 3000+ Issues in Cloud Systems
33 What is green energy? 什么是绿色能源?.docx
This is document by symantec endpoint protection. New version 12.1.
新人教版八年级下册英语 Unit 1 What’s the matter? 全套课件.pptx
五年级英语上册 Lesson 9 What's Your Father?教案 新路径(一起).doc
五年级英语上册 Lesson 6 What's an Insect?教案 新路径(一起).doc
五年级英语上册 Unit 4 What can you do?教案 人教PEP.doc
接力版四年级下册小学英语 Lesson 6 What is it doing?说课稿.doc