- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 223字
- 2021-08-05 10:46:43
Livelocks
Livelocks are similar to deadlocks, in the sense that they also happen when the application can't correctly continue its execution. The difference is that during a livelock the state of the application is constantly changing, but the state changes in a way that further prevents the application from resuming normal execution.
Commonly, a livelock is explained by picturing two people, Elijah and Susan, walking in opposite directions in a narrow corridor. Both of them try to avoid the other by moving to one side: Elijah moves to the left while Susan moves to the right, but since they are walking in opposite directions, they are now blocking each other's way. So, now Elijah moves to the right, just at the same time that Susan moves to the left: once again they are unable to continue on their way. They continue moving like this, and thus they continue to block each other:

In this example, both Elijah and Susan have an idea of how to recover from a deadlock—each blocking the other—but the timing of their attempts to recover further obstructs their progress.
As expected, livelocks often happen in algorithms designed to recover from a deadlock. By trying to recover from the deadlock, they may in turn create a livelock.
- 深入核心的敏捷開發(fā):ThoughtWorks五大關(guān)鍵實踐
- 一步一步學(xué)Spring Boot 2:微服務(wù)項目實戰(zhàn)
- Mobile Application Development:JavaScript Frameworks
- 兩周自制腳本語言
- 深度學(xué)習(xí)經(jīng)典案例解析:基于MATLAB
- Linux C/C++服務(wù)器開發(fā)實踐
- Learning Docker
- MongoDB for Java Developers
- 精通搜索分析
- Java程序設(shè)計
- Haxe Game Development Essentials
- Go并發(fā)編程實戰(zhàn)
- Getting Started with Polymer
- Python計算機(jī)視覺和自然語言處理
- Getting Started with Python