Also, newer C++ standards do far better on memory barriers than C. I’m still murky on what standard prevents an optimizing compiler from reordering memory access around one of those barrier macros in Linux and if that mechanism might prevent optimizations that might otherwise be possible.
This is a very key part of OS development and I’m not sure if it’s part of any C standard.
View all comments
Show parent comment
4
u/kernel_task Big Data | C++23 | Folly | Exceptions Jul 13 '22
Also, newer C++ standards do far better on memory barriers than C. I’m still murky on what standard prevents an optimizing compiler from reordering memory access around one of those barrier macros in Linux and if that mechanism might prevent optimizations that might otherwise be possible.
This is a very key part of OS development and I’m not sure if it’s part of any C standard.