O'Reilly logo

Shared Memory Application Programming by Victor Alessandrini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required