C++ has a well defined memory model: https://en.cppreference.com/w/cpp/language/memory_model And it's not that different from the C memory model. How did Linux work with C?
> C++ has a well defined memory model
Only since C++11, and it's not a full blown memory model.
Re:Moving the Linux Kernel to Modern C
by gpderetta on Friday February 25, 2022 @06:00AM
(#30465921)
C++ has with a close, approximation, the same memory model as C, both concurrent and otherwise. In fact C11 just adopted the C++11 concurrent memory model wholesale.
Re:Moving the Linux Kernel to Modern C
by jcelerier on Friday February 25, 2022 @05:39AM
(#30465784)
it's defined enough for C to have adopted it since C11 (https://people.mpi-sws.org/~viktor/papers/cpp2015-invited.pd...)
Its not what is being discussed here. C++ has an implementation defined memory model. That just cannot work with Linux out of the box. You need an OS and compiler designed from the ground up to handle this.