lock convoy

Uses your system voice; voice and rate in settings.

Q6665292Snapshot

≈ 4 min read

Names in other languages

  • mnConvoy effect
  • SvenskaKonvojeffekt
  • Englishlock convoy
  • 日本語コンボイ

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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. 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. A lock convoy behaves similarly to car convoys ("wide moving jam") forming and dissipating on highways suffering traffic congestion: when more cars drive on the road than the road can sustain, one car eventually has to stop. Cars coming right after it will also stop one after the other; this forms the convoy. Then when the first cars in the convoy can move again, new cars are still stopping at the rear of the convoy.

While the cars at the front of the convoy can make progress, all the cars in the convoy have to wait in queue before being able to make progress again. 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.…

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. 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. A lock convoy behaves similarly to car convoys ("wide moving jam") forming and dissipating on highways suffering traffic congestion: when more cars drive on the road than the road can sustain, one car eventually has to stop. Cars coming right after it will also stop one after the other; this forms the convoy. Then when the first cars in the convoy can move again, new cars are still stopping at the rear of the convoy.

While the cars at the front of the convoy can make progress, all the cars in the convoy have to wait in queue before being able to make progress again. 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.

References

Text derived from https://en.wikipedia.org/w/index.php?oldid=1373894726 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot lock-convoy-754725-96de0de2f04cce57 · hash 96de0de2f04cce57293672974f732f39a27b76719ca856ad8cae46d47ab5ca21 · captured 1788876119.0 · version history

Cite this page as: encyclopegia.org, “lock convoy”, snapshot lock-convoy-754725-96de0de2f04cce57. https://encyclopegia.org/a/lock-convoy

Sources cited in this revision

1 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.