Chapter 8

Shared-memory concurrency control with a data-structures focus

Dan Grossman*    * University of Washington

Abstract

This chapter is a companion to Chapter 7. It introduces the need for concurrency control (synchronization) when threads are accessing shared resources, particularly shared memory. It presents the need for mutual-exclusion locks and how to use them correctly. The presentation focuses on the concept of locking first and then the details of locks (via synchronized statements and methods) in Java. It then draws a distinction between bad interleavings—when observable intermediate states cause a software component in a concurrent setting not to meet its specification—and data races, in which modern platforms’ relaxed memory-consistency ...

Get Topics in Parallel and Distributed Computing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.