Currently, In the shared memory c++ implementation If the writer updates the simulation state while the reader is reading it, the reader might get corrupted data (half old state, half new state).
The write_SM function writes to the shared memory buffer using without acquiring a lock, which will let the read_sm function 'read' simultaneously when write_Sm is running 'write'. This should not happen, this will result in corrupted data to the reader.