|message passing - One of the two techniques for communicating between parallel
processes (the other being shared memory).|
A common use of message passing is for communication in a parallel computer. A process running on one processor may send a message to a process running on the same processor or another. The actual transmission of the message is usually handled by the run-time support of the language in which the processes are written, or by the operating system.
Message passing scales better than shared memory, which is generally used in computers with relatively few processors. This is because the total communications bandwidth usually increases with the number of processors.
A message passing system provides primitives for sending and receiving messages. These primitives may by either synchronous or asynchronous or both. A synchronous send will not complete (will not allow the sender to proceed) until the receiving process has received the message. This allows the sender to know whether the message was received successfully or not (like when you speak to someone on the telephone). An asynchronous send simply queues the message for transmission without waiting for it to be received (like posting a letter). A synchronous receive primitive will wait until there is a message to read whereas an asynchronous receive will return immediately, either with a message or to say that no message has arrived.
Messages may be sent to a named process or to a named mailbox which may be readable by one or many processes.
Transmission involves determining the location of the recipient and then choosing a route to reach that location. The message may be transmitted in one go or may be split into packets which are transmitted independently (e.g. using wormhole routing) and reassembled at the receiver. The message passing system must ensure that sufficient memory is available to buffer the message at its destination and at intermediate nodes.
Messages may be typed or untyped at the programming language level. They may have a priority, allowing the receiver to read the highest priority messages first.
Some message passing computers are the MIT J-Machine, the Illinois Concert Project and transputer-based systems.
Object-oriented programming uses message passing between objects as a metaphor for procedure call.