Chapter 27
Waiting for Locks
This chapter is a case study of software lock delays. Using a small multi-threaded program that does fake bank transactions against a shared RAM database, locking it during updates, we will examine unexpected execution dynamics.
From our framework, this chapter is about not running while waiting for software locks. With two or more processes, the execution dynamics can involve excessive delays and even starvation through lock saturation and insidious lock capture. After exploring delays, we will look at fixes.
27.1 Overview
As we saw in previous chapters, software locks protect critical sections—pieces of code ...
Get Understanding Software Dynamics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.