Chapter 8

Atomic Types and Operations

Abstract

A detailed discussion of the powerful atomic classes proposed by C++11 and TBB, as well as the Windows atomic services, is presented, with special emphasis on the way they can be used to implement efficient, custom synchronization utilities. First, lock-free algorithms are described, capable of enforcing thread safety in shared data accesses not using mutex locking. Next, the memory consistency constraints embedded in the atomic services are used to implement custom synchronization patterns based on “happens before” relations among operations in different threads. Two rather subtle examples are proposed, implementing synchronization utilities incorporated in the vath library.

Keywords

Atomic ...

Get Shared Memory Application Programming now with O’Reilly online learning.

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