Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 25s8 days 9 hours 54 minutes 25 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 25s8 days 9 hours 54 minutes 25 seconds.

Sign in to watch this lesson
The C++ Memory Model and Atomics · 4:09
What C++ promises when two threads touch memory. Every scalar variable is its own memory location, except that adjacent bit fields share one: on a Mac, two threads incrementing their own bit fields lost hundreds of thousands of updates per run because each increment loads and stores the whole 8-byte word. Each location has one modification order that every thread agrees on (coherence: 80 million loads, never backwards), but threads need not agree on the order of writes to different variables, as an IRIW litmus test with relaxed atomics showed.