





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Department of Computer Science Rice University [email protected]
COMP 522 Lecture 12 9 October 2008
Why a C++ Concurrency Memory Model?
Problems with Thread Libraries
Avoiding Data Races
Review of Memory Model Motivation
Review of Memory Model Flavors
A Concurrency Memory Model for C++
Preliminaries
C++ Concurrency Memory Model
—Q: why can a program have more than one sequentially consistent execution?
Optimizations Allowed
—M1 is data operation and M2 is write to a lock —M1 is unlock and M2 is read or write to a different lock
(1) Sequentially Consistent Atomics
—except on Itanium, existing ISAs don’t distinguish synch ops —compilers typically enforce orderings with fence instructions
Cost of Enforcing Write Atomicity
Consequences of Relaxing Write Atomicity
Consequences of Relaxing Write Atomicity