I have a piece of shared memory that contains a char string and an integer between two processes.
Process A writes to it and Process B reads it (and not vice versa)
What is the most efficient and effective way to make sure that Process A doesn’t happen to update (write to it) that same time Process B is reading it? (Should I just use flags in the shared memory, use semaphores, critical section….)
If you could point me in the right direction, I would appreciate it.
Thanks.
Windows, C++
Since you have two processes you need a cross-process synchronisation object. I think this means that you need to use a mutex.