C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 2
Channel:alexsmail · Length:1:32:33 · Published:2017-11-06 · Views:29517
Summary
Part two of Herb Sutter's C++ and Beyond 2012 session on atomic weapons, a deep dive into the C++ memory model, atomics, memory ordering, and hardware behavior. It ends with the modern meaning of volatile.
Why HN recommends it
HN recommends it as an in-depth, practical introduction to atomics and weak versus strong memory ordering, relevant to ARM and Rust as well as C++.
For a more in depth introduction to the topic with a lot of practical code examples, I highly recommend — HN, 2023
C, C++, Rust, Go & systems languages · Computer architecture & CPUs
Subtitles (excerpt)
a couple of questions that came up during the break let me just go back here these last series of slides was called why stand alone fences are suboptimal so the question that arose was does this mean we shouldn't use them the answer is yes and here's why so clearly I need to add a slide saying and key takeaway is advices avoid stand alone fences because they're very heavyweight and they prevent more optimizations than they need to so they cost more in synchronization and they cost more on optimization now having said that if you are on a system that does not have standard mutexes or mutexes at all or does not have standard Atomics and you want to write lock free code then you may need to use that but those are getting more and more of a historical kind of artifact and hopefully we will be able to get away from this world another one if we go back a few slides the question was I mentioned fences together with ordered api's these are really this is sort of a bucket of things you should try to avoid and use mutexes and Atomics instead but the ordered api's are actually better than the standalone fences the reason is is because notice when you do an interlocked exchange you say flag one address of flag one to one I'm
On Hacker News
"Is Parallel Programming Hard, And, If So, What Can You Do About It?" is one of the best books about atomics and concurrency, and my #2 recommendation. [LINK] My #1 actually isn't a book at all, but the two "atomic Weapons" talks by Herb Sutter, which are extremely good. [LINK] [VIDEO] — chc4, 2024-08
For a more in depth introduction to the topic with a lot of practical code examples, I highly recommend Herb Sutter’s excellent talk: Part 1 [LINK] Part 2 [VIDEO] — NobodyNada, 2023-11
The book, especially chapter 7 seems to say several things completely opposite to what Herb Sutter did in his famous talk a number of years ago. In the book: > This means that on ARM64, sequentially consistent operations are exactly as cheap as acquire and release operations. Or, rather, that ARM64 Acquire, Release, and AcqRel operations are as expensive as SeqCst. Unlike x86-64, however, Relaxed… — mlindner, 2023-01
I would imagine that any implementation of x86 would have to bear the weight of reverse-compatibility. With reverse comparability, the bad design decisions just compound, for example complicated stuff like memory synchronization [VIDEO] — cowtools, 2022-07
It’s true that ARM alone isn’t the reason for the M1’s performance, but it’s definitely a significant factor. x86 is old — modern x86 chips are still backwards-compatible with the original 8086 from 1978 — and it’s stuck with plenty of design decisions that might have been the correct choice sometime within the past 45 years but no longer today. Whereas the M1 only implements AArch64, a complete … — NobodyNada, 2021-10
Related videos
- C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2 · alexsmail · 1:21:12
- 8-bit computer update · Ben Eater · 6:53
- CppCon 2015: Andrei Alexandrescu “std::allocator...” · CppCon · 1:12:27
- Light Years Ahead | The 1969 Apollo Guidance Computer · TNMoC · 1:21:22
- Lexical Scanning in Go - Rob Pike · GoogleFOSSSydney · 51:17
- “Hello, world” from scratch on a 6502 — Part 1 · Ben Eater · 27:24
- Finding the Missing Memristor - R. Stanley Williams · The Qualcomm Institute · 47:52
- The Ultimate Game Boy Talk (33c3) · media.ccc.de · 1:01:06
- The Thirty Million Line Problem · Molly Rocket · 1:48:55
- CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step” · CppCon · 59:33
- RustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West · Rust Programming Language · 42:29
- CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17” · CppCon · 1:19:52
- USENIX ATC '21/OSDI '21 Joint Keynote Address-It's Time for Operating Systems to Rediscover Hardware · USENIX · 1:06:19
- Ideas about a new programming language for games. · Jonathan Blow · 1:55:24
- CppCon 2014: Mike Acton "Data-Oriented Design and C++" · CppCon · 1:27:46
- How I program C · Eskil Steenberg · 2:11:32