5
Atomic Operations
In Chapter 4, we learned about lock-based thread synchronization. We learned about mutexes, condition variables, and other thread synchronization primitives, which are all based on acquiring and releasing locks. Those synchronization mechanisms are built on top of atomic types and operations, this chapter’s topic.
We will study what atomic operations are and how they differ from lock-based synchronization primitives. After reading this chapter, you will have a basic knowledge of atomic operations and some of their applications. Lock-free (not using locks) synchronization based on atomic operations is a very complex subject requiring years to master, but we will give you what we hope will be a good introduction to the subject. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access