This question already has an answer here:Is the get_a() function safe for race-conditions or do I need to explicitly copy str_ as in get_b() in order to have a thread-safe function?
Lets say I have a struct: Now from what I understand, the C++ standard guarantees the safety of the above when two threads operate on the two different memory locations.
Is a mutex defined statically in a function body able to lock properly? I am currently using this pattern in my logger system, but I have not tested it's thread safety yet.
I know that there exists a int128_t type in C and C++.If I have two threads one that is reading from a memory location containing this 128 bit integer and another that is writting to it.