-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The C++ Programmer's Mindset
By :
The main mechanism for communicating between processes is message passing. Here, small packets of data are passed between the processes via a separate channel: a network socket, a UNIX socket, or otherwise. Passing messages should be regarded as a fairly expensive operation, and the amount of information passed between processes should be fairly minimal. In the (somewhat rare) circumstance that all processes are running on the same computer, shared memory can be used as a very high-speed interchange for data. The same restrictions for accesses among many threads apply here; data accesses to shared memory must be synchronized using process-level synchronization mechanisms, such as mutexes and locks discussed earlier.
The standard tool for passing messages between processes as part of a larger system of distributed work is the MPI. This is a standard interface, implemented by various vendors such as Microsoft and the open source OpenMPI, that provides...