Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Message passing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Synchronous versus asynchronous message passing== {{one source|section|date=February 2015}} ===Synchronous message passing=== Synchronous message passing occurs between objects that are running at the same time. It is used by object-oriented programming languages such as [[Java (programming language)|Java]] and [[Smalltalk]]. 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 completes. This can make synchronous communication unworkable for some applications. For example, large, distributed systems may not perform well enough to be usable. Such large, distributed systems may need to operate while some of their subsystems are down for maintenance, etc. Imagine a busy business office having 100 desktop computers that send emails to each other using synchronous message passing exclusively. 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. ===Asynchronous message passing=== With asynchronous message passing the receiving object can be down or busy when the requesting object sends the message. Continuing the function call analogy, it is like a function call that returns immediately, without waiting for the called function to complete. Messages are sent to a queue where they are stored until the receiving process requests them. The receiving process processes its messages and sends results to a queue for pickup by the original process (or some designated next process).<ref>{{cite book|last=Orfali|first=Robert|title=The Essential Client/Server Survival Guide|year=1996|publisher=Wiley Computer Publishing|location=New York|isbn=0-471-15325-7|pages=[https://archive.org/details/essentialclients00orfa/page/95 95β133]|url=https://archive.org/details/essentialclients00orfa/page/95}}</ref> 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). The buffer required in [[asynchronous communication]] can cause problems when it is full. A decision has to be made whether to block the sender or whether to discard future messages. A blocked sender may lead to [[Deadlock (computer science)|deadlock]]. If messages are dropped, communication is no longer reliable. ===Hybrids=== Synchronous communication can be built on top of asynchronous communication by using a [[Synchronizer (algorithm)|Synchronizer]]. For example, the Ξ±-Synchronizer works by ensuring that the sender always waits for an acknowledgement message from the receiver. The sender only sends the next message after the acknowledgement has been received. On the other hand, asynchronous communication can also be built on top of synchronous communication. For example, modern [[microkernel]]s generally only provide a [[Microkernel#Inter-process communication|synchronous messaging]] primitive{{Citation needed|date=April 2015}} and asynchronous messaging can be implemented on top by using [[Thread (computing)|helper threads]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)