Sometimes we write programs that will communicate with each other a lot. When programs are run on different machines, using sockets is the most common technique for communication. But if multiple processes run on a single machine, we can do much better!
Let's take a look at how to make a single memory fragment available from different processes using the
Basic knowledge of C++ is required for this recipe. Knowledge of atomic variables is also required (take a look at the See also section for more information about atomics). Some platforms require linking against the runtime library.
In this example we'll be sharing a single atomic variable between ...