Using pipes

When we are explaining synchronization, it is absolutely necessary to give an example with processes. Unlike working in single address space, as with threads, working with multiple processes and their address spaces has its upsides and downsides.

The upsides are generally, in lower probability of errors. The context and address space of a process is private for the process and all its resources, including threads. If you allocate some memory location in one process and pass a pointer to another process, it will be meaningless! The operating system creates separate address spaces for all processes. The running process does not know anything about other processes, and as such, it is greedy: it wants all resources for itself. So, when ...

Get C++ Multithreading Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.