O'Reilly logo

Patterns for Parallel Software Design by Jorge Luis Ortega-Arjona

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.4. 5.4 Message Passing

Message passing is an interprocess communication and synchronization mechanism between two or more parallel or distributed software components, executing simultaneously, non-deterministically and at different relative speeds in different address spaces of different computers within a distributed memory parallel platform. Message passing allows the synchronization and data transfer of a message using two communication primitives: send and receive. These are the only way of allowing exchange of data between the parallel or distributed software components. No assumptions can be made about when messages are sent or received [Hoa78] [And91] [Bac93] [GBD+94] [Bri95] [Har98] [HX98] [And00].

5.4.1. Example

Parallel Virtual Machine (PVM) is a message-passing library extension for C, Fortran and C++ for exploiting distributed, heterogeneous computing resources. It is capable of creating and executing processes on different computers within a distributed memory platform. To allow data exchange among distributed processes, PVM specifies several routines for sending and receiving data between processes [GBD+94] [And00]:

  • Sending a message comprises three steps: (a) a send buffer must be initialized by the routines pvm_initsend() or pvm_mkbuf(), (b) the message is 'packed' into the buffer, using some of the pvm_pk*() routines, and (c) the message is sent to another process by the pvm_send() or pvm_mcast() routines.

  • Receiving a message requires two steps: (a) messages ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required