C++11 introduces a new memory model that lets the abstract machine "running" C++11 code have a notion about multiple threads. It also introduces a set of memory orders by which memory load/store operations abide.
The wikipedia page of C++20 says that it has
a revised memory model.
The reference it gives says that the memory model of C++11 has a number of flaws, which C++20 will revise.
Could someone please give some examples about the problems that come with C++11's memory model, and how that in C++20 would fix it?
Related question: Introduction to C++11's memory model
As @PeterM suggests, its' a (subjectively) minor change due to issues discovered ex-post-facto with the formalization of the C++11 memory model.
The old model was defined so that different regimes of memory access could be implemented on common architectures using more or less-costly sets of hardware instructions. Specifically, memory_order_acquire
and memory_order_release
were supposed to be implementable on ARM and Power CPU architectures using some kind of lightweight fence instructions. Unfortunately, it turns out that they can't (!); and this is also true for NVIDIA GPUs, although those weren't really targeted a decade back.
With this being the case, there were two options:
Option 2 was apparently chosen.
For more details, read:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With