- 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.
- iOS面試一戰到底
- 流量的秘密:Google Analytics網站分析與優化技巧(第2版)
- Julia機器學習核心編程:人人可用的高性能科學計算
- Building Mapping Applications with QGIS
- SharePoint Development with the SharePoint Framework
- 零基礎學C語言(升級版)
- Java程序設計教程
- 數據結構:Python語言描述
- MATLAB 2020 GUI程序設計從入門到精通
- Clojure Web Development Essentials
- Mastering Drupal 8
- Beginning C# 7 Hands-On:The Core Language
- Python機器學習
- Java Web 從入門到項目實踐(超值版)
- JavaScript全棧開發