Lock convoy explained

In computer science, a lock convoy is a performance problem that can occur when using locks for concurrency control in a multithreaded application.

A lock convoy occurs when multiple threads of equal priority contend repeatedly for the same lock.[1] [2] Unlike deadlock and livelock situations, the threads in a lock convoy do progress; however, each time a thread attempts to acquire the lock and fails, it relinquishes the remainder of its scheduling quantum and forces a context switch. The overhead of repeated context switches and underutilization of scheduling quanta degrade overall performance.

Lock convoys often occur when concurrency control primitives such as locks serialize access to a commonly used resource, such as a memory heap or a thread pool. They can sometimes be addressed by using non-locking alternatives such as lock-free algorithms or by altering the relative priorities of the contending threads.

See also

Notes and References

  1. Book: Silberschatz. Abraham. Operating System Concepts.. 2013. John Wiley & Sons Inc. 978-1118129388.
  2. Blasgen. Mike. Gray. Jim. Mitoma. Mike. Blasgen. Mike. Mitoma. Like. 1979. The convoy phenomenon. Operating Systems Review. 13 . 2 . 20–25 . 10.1145/850657.850659 . 10.1.1.646.921 . 40305779 .