encyclopegia.org

Message passing

In computer science, message passing is a technique for invoking behavior (i.e., running a program) on a computer.[src] The invoking program sends a message to a process (which may be an actor or object) and relies on that process and its supporting infrastructure to then select and run some appropriate code.[src] Message passing differs from conventional programming where a process, subroutine, or function is directly invoked by name.[src] Message passing is key to some models of concurrency and object-oriented programming.[src] Message passing is ubiquitous in modern computer software.[src] It is used as a way for the objects that make up a program to work with each other and as a means for objects and systems running on different computers (e.g., the Internet) to interact.[src] Message passing may be implemented by various mechanisms, including channels.[src]

In computer science, message passing is a technique for invoking behavior (i.e., running a program) on a computer.[src] The invoking program sends a message to a process (which may be an actor or object) and relies on that process and its supporting infrastructure to then select and run some appropriate code.[src] Message passing differs from conventional programming where a process, subroutine, or function is directly invoked by name.[src] Message passing is key to some models of concurrency and object-oriented programming.[src] Message passing is ubiquitous in modern computer software.[src] It is used as a way for the objects that make up a program to work with each other and as a means for objects and systems running on different computers (e.g., the Internet) to interact.[src] Message passing may be implemented by various mechanisms, including channels.[src] ==Overview== Message passing is a technique for invoking behavior (i.e., running a program) on a computer.[src] In contrast to the traditional technique of calling a program by name, message passing uses an object model to distinguish the general function from the specific implementations.[src] The invoking program sends a message and relies on the object to select and execute the appropriate code.[src] The justifications for using an intermediate layer essentially falls into two categories: encapsulation and distribution.[src] Message passing is a core technique used for communication between processes, threads, objects, or nodes in both concurrent and distributed systems.[src] It enables software components to exchange information without sharing memory, often using communication channels, buffers, or middleware to transport messages between senders and receivers.[src] In some models, message passing can be implemented synchronously, where the sender waits for a reply, or asynchronously, where messages are queued for later processing.[src] One application of message passing can be found in the domain of computer graphics.[src] There are various complexities involved in manipulating graphic objects.[src] For example, simply using the right formula to compute the area of an enclosed shape will vary depending on if the shape is a triangle, rectangle, ellipse, or circle.[src] In traditional computer programming, this would result in long IF-THEN statements testing what sort of object the shape was and calling the appropriate code.[src] The object-oriented way to handle this is to define a class called Shape with subclasses such as Rectangle and Ellipse (which, in turn, have subclasses Square and Circle ) and then to simply send a message to any Shape asking it to compute its area.[src] Each Shape object will then invoke the subclass's method with the formula appropriate for that kind of object.[src] Distributed message passing provides developers with a layer of the architecture that provides common services to build systems made up of sub-systems that run on disparate computers in different locations and at different times.[src] When a distributed object is sending a message, the messaging layer can take care of issues such as: Finding the process using different operating systems and programming languages, at different locations from where the message originated.[src] Saving the message on a queue if the appropriate object to handle the message is not currently running and then invoking the message when the object is available.[src] Also, storing the result if needed until the sending object is ready to receive it.[src] Controlling various transactional requirements for distributed transactions, e.g.[src] atomicity, consistency, isolation, durability (ACID) testing the data.[src] ==Synchronous versus asynchronous message passing== ===Synchronous message passing=== Synchronous message passing occurs between objects that are running at the same time.[src] It is used by object-oriented programming languages such as Java and Smalltalk.[src] Synchronous messaging is analogous to a synchronous function call; just as the function caller waits until the function completes, the sending process waits until the receiving process accepts the message.[src] This can make synchronous communication unworkable for some applications.[src] For example, large, distributed systems may not perform well enough to be usable.[src] Such large, distributed systems may need to operate while some of their subsystems are down for maintenance, etc.[src] Imagine a busy business office having 100 desktop computers that send emails to each other using synchronous message passing exclusively.[src] One worker turning off their computer can cause the other 99 computers to freeze until the worker turns their computer back on to process a single email.[src] ===Asynchronous message passing=== Message passing systems can be broadly categorized based on how send and receive operations interact with executing processes.[src] In synchronous message passing, the sending process may block until the receiver has accepted the message, ensuring tight coordination.[src] In asynchronous models, the sender continues execution after sending a message, and messages are typically stored in a queue or buffer until the receiving process retrieves them.[src] With asynchronous message passing the receiving object can be down or busy when the requesting object sends the message.[src] Continuing the function call analogy, it is like a function call that returns immediately, without waiting for the called function to complete.[src] Messages are sent to a queue where they are stored until the receiving process requests them.[src] The receiving process processes its messages and sends results to a queue for pickup by the original process (or some designated next process).[src] Asynchronous messaging requires additional capabilities for storing and retransmitting data for systems that may not run concurrently, and are generally handled by an intermediary level of software (often called middleware); a common type being Message-oriented middleware (MOM).[src] The buffer required in asynchronous communication can cause problems when it is full.[src] A decision has to be made whether to block the sender or whether to discard future messages.[src] A blocked sender may lead to deadlock.[src] If messages are dropped, communication is no longer reliable.[src] ===Hybrids=== Synchronous communication can be built on top of asynchronous communication by using a Synchronizer.[src] For example, the α-Synchronizer works by ensuring that the sender always waits for an acknowledgement message from the receiver.[src] The sender only sends the next message after the acknowledgement has been received.[src] On the other hand, asynchronous communication can also be built on top of synchronous communication.[src] For example, modern microkernels generally only provide a synchronous messaging primitive and asynchronous messaging can be implemented on top by using helper threads.[src] ==Distributed objects== Message-passing systems use either distributed or local objects.[src] With distributed objects the sender and receiver may be on different computers, running different operating systems, using different programming languages, etc.[src] In this case the bus layer takes care of details about converting data from one system to another, sending and receiving data across the network, etc.[src] The Remote Procedure Call (RPC) protocol in Unix was an early example of this.[src] With this type of message passing it is not a requirement that sender nor receiver use object-oriented programming.[src] Procedural language systems can be wrapped and treated as large grained objects capable of sending and receiving messages.[src] Examples of systems that support distributed objects are: Emerald, ONC RPC, CORBA, Java RMI, DCOM, SOAP, .NET Remoting, CTOS, QNX Neutrino RTOS, OpenBinder and D-Bus.[src] Distributed object systems have been called "shared nothing" systems because the message passing abstraction hides underlying state changes that may be used in the implementation of sending messages.[src] Distributed, or asynchronous, message-passing has additional overhead compared to calling a procedure.[src] In message-passing, arguments must be copied to the new message.[src] Some arguments can contain megabytes of data, all of which must be copied and transmitted to the receiving object.[src] Traditional procedure calls differ from message-passing in terms of memory usage, transfer time and locality.[src] Arguments are passed to the receiver typically by general-purpose registers requiring no additional storage nor transfer time, or in a parameter list containing the arguments' addresses (a few bits).[src] Address-passing is not possible for distributed systems since the systems use separate address spaces.[src] Web browsers and web servers are examples of processes that communicate by message-passing.[src] A URL is an example of referencing a resource without exposing process internals.[src] A subroutine call or method invocation will not exit until the invoked computation has terminated.[src] Asynchronous message-passing, by contrast, can result in a response arriving a significant time after the request message was sent.[src] A message-handler will, in general, process messages from more than one sender.[src] This means its state can change for reasons unrelated to the behavior of a single sender or client process.[src] This is in contrast to the typical behavior of an object upon which methods are being invoked: the latter is expected to remain in the same state between method invocations.[src] In other words, the message-handler behaves analogously to a volatile object.[src] ==Mathematical models== The prominent mathematical models of message passing are the Actor model and Pi calculus.[src] In mathematical terms a message is the single means to pass control to an object.[src] If the object responds to the message, it has a method for that message.[src] Alan Kay has argued that message passing is more important than objects in OOP, and that objects themselves are often over-emphasized.[src] The live distributed objects programming model builds upon this observation; it uses the concept of a distributed data flow to characterize the behavior of a complex distributed system in terms of message patterns, using high-level, functional-style specifications.[src] ==Examples== Actor model implementation Amorphous computing Communicating sequential processes Flow-based programming SOAP ==See also== Active message Distributed computing Event loop Messaging pattern Message passing in computer clusters Message Passing Interface Parallel Virtual Machine (PVM) Programming languages that include message passing as a centric feature: AppleScript Erlang Elixir HyperCard, LiveCode Go Objective-C Rust Scala Smalltalk Self Concurrent ML ==References== ==Further reading== ==External links== A Packet History of Message Passing[src]

86 sentences · 86 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Message passing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/message-passing. Accessed 25 November 2026.

Chicago

"Message passing." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/message-passing.

APA

encyclopegia.org. (2026). Message passing. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/message-passing

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Message Passing Interface

stub · references available

Message to Adolf

stub · references available

SWIFT message types

stub · references available

Message

stub · references available

A Message to Garcia

stub · references available

1st Message

stub · references available

Church of Christ With the Elijah Message

stub · references available

Passing Mother's Grave

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1373581289 · 0.5 · snapshot enwiki-001373581289

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.