message passing
message passing
A common use of message passing is for communication in aparallel computer. A process running on one processor maysend a message to a process running on the same processor oranother. The actual transmission of the message is usuallyhandled by the run-time support of the language in which theprocesses are written, or by the operating system.
Message passing scales better than shared memory, which isgenerally used in computers with relatively few processors.This is because the total communications bandwidth usuallyincreases with the number of processors.
A message passing system provides primitives for sending andreceiving messages. These primitives may by eithersynchronous or asynchronous or both. A synchronous sendwill not complete (will not allow the sender to proceed) untilthe receiving process has received the message. This allowsthe sender to know whether the message was receivedsuccessfully or not (like when you speak to someone on thetelephone). An asynchronous send simply queues the messagefor transmission without waiting for it to be received (likeposting a letter). A synchronous receive primitive will waituntil there is a message to read whereas an asynchronousreceive will return immediately, either with a message or tosay that no message has arrived.
Messages may be sent to a named process or to a namedmailbox which may be readable by one or many processes.
Transmission involves determining the location of therecipient and then choosing a route to reach that location.The message may be transmitted in one go or may be split intopackets which are transmitted independently (e.g. usingwormhole routing) and reassembled at the receiver. Themessage passing system must ensure that sufficient memory isavailable to buffer the message at its destination and atintermediate nodes.
Messages may be typed or untyped at the programming languagelevel. They may have a priority, allowing the receiver toread the highest priority messages first.
Some message passing computers are the MIT J-Machine, theIllinois Concert Project andtransputer-based systems.
Object-oriented programming uses message passing betweenobjects as a metaphor for procedure call.