- 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.
- R語(yǔ)言數(shù)據(jù)分析從入門(mén)到精通
- C#編程入門(mén)指南(上下冊(cè))
- Ext JS Data-driven Application Design
- Vue.js 3.0源碼解析(微課視頻版)
- Scala編程實(shí)戰(zhàn)(原書(shū)第2版)
- HTML5從入門(mén)到精通 (第2版)
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲(chóng)案例實(shí)戰(zhàn)全流程詳解(入門(mén)與提高篇)
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- 零基礎(chǔ)學(xué)C++(升級(jí)版)
- Getting Started with Electronic Projects
- Mobile Forensics:Advanced Investigative Strategies
- Koa與Node.js開(kāi)發(fā)實(shí)戰(zhàn)
- Practical Time Series Analysis
- Illustrator CS6中文版應(yīng)用教程(第二版)
- Slick2D Game Development