<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
message	B-Architecture
passing	I-Architecture
is	O
a	O
technique	O
for	O
invoking	O
behavior	O
(	O
i.e.	O
,	O
running	O
a	O
program	B-Application
)	O
on	O
a	O
computer	O
.	O
</s>
<s>
The	O
invoking	O
program	B-Application
sends	O
a	O
message	O
to	O
a	O
process	B-Operating_System
(	O
which	O
may	O
be	O
an	O
actor	B-Application
or	O
object	O
)	O
and	O
relies	O
on	O
that	O
process	B-Operating_System
and	O
its	O
supporting	O
infrastructure	O
to	O
then	O
select	O
and	O
run	O
some	O
appropriate	O
code	O
.	O
</s>
<s>
Message	B-Architecture
passing	I-Architecture
differs	O
from	O
conventional	O
programming	O
where	O
a	O
process	B-Operating_System
,	O
subroutine	O
,	O
or	O
function	O
is	O
directly	O
invoked	O
by	O
name	O
.	O
</s>
<s>
Message	B-Architecture
passing	I-Architecture
is	O
key	O
to	O
some	O
models	O
of	O
concurrency	O
and	O
object-oriented	B-Language
programming	I-Language
.	O
</s>
<s>
Message	B-Architecture
passing	I-Architecture
is	O
ubiquitous	O
in	O
modern	O
computer	O
software	O
.	O
</s>
<s>
It	O
is	O
used	O
as	O
a	O
way	O
for	O
the	O
objects	O
that	O
make	O
up	O
a	O
program	B-Application
to	O
work	O
with	O
each	O
other	O
and	O
as	O
a	O
means	O
for	O
objects	O
and	O
systems	O
running	O
on	O
different	O
computers	O
(	O
e.g.	O
,	O
the	O
Internet	O
)	O
to	O
interact	O
.	O
</s>
<s>
Message	B-Architecture
passing	I-Architecture
may	O
be	O
implemented	O
by	O
various	O
mechanisms	O
,	O
including	O
channels	B-Operating_System
.	O
</s>
<s>
Message	B-Architecture
passing	I-Architecture
is	O
a	O
technique	O
for	O
invoking	O
behavior	O
(	O
i.e.	O
,	O
running	O
a	O
program	B-Application
)	O
on	O
a	O
computer	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
traditional	O
technique	O
of	O
calling	O
a	O
program	B-Application
by	O
name	O
,	O
message	B-Architecture
passing	I-Architecture
uses	O
an	O
object	B-Application
model	I-Application
to	O
distinguish	O
the	O
general	O
function	O
from	O
the	O
specific	O
implementations	O
.	O
</s>
<s>
The	O
invoking	O
program	B-Application
sends	O
a	O
message	O
and	O
relies	O
on	O
the	O
object	O
to	O
select	O
and	O
execute	O
the	O
appropriate	O
code	O
.	O
</s>
<s>
The	O
justifications	O
for	O
using	O
an	O
intermediate	O
layer	O
essentially	O
falls	O
into	O
two	O
categories	O
:	O
encapsulation	B-Application
and	O
distribution	O
.	O
</s>
<s>
Encapsulation	B-Application
is	O
the	O
idea	O
that	O
software	O
objects	O
should	O
be	O
able	O
to	O
invoke	O
services	O
on	O
other	O
objects	O
without	O
knowing	O
or	O
caring	O
about	O
how	O
those	O
services	O
are	O
implemented	O
.	O
</s>
<s>
Encapsulation	B-Application
can	O
reduce	O
the	O
amount	O
of	O
coding	O
logic	O
and	O
make	O
systems	O
more	O
maintainable	O
.	O
</s>
<s>
The	O
object-oriented	B-Language
way	O
to	O
handle	O
this	O
is	O
to	O
define	O
a	O
class	O
called	O
Shape	O
with	O
subclasses	O
such	O
as	O
Rectangle	O
and	O
Ellipse	O
(	O
which	O
in	O
turn	O
have	O
subclasses	O
Square	O
and	O
Circle	O
)	O
and	O
then	O
to	O
simply	O
send	O
a	O
message	O
to	O
any	O
Shape	O
asking	O
it	O
to	O
compute	O
its	O
area	O
.	O
</s>
<s>
Each	O
Shape	O
object	O
will	O
then	O
invoke	O
the	O
subclass	O
's	O
method	B-Language
with	O
the	O
formula	O
appropriate	O
for	O
that	O
kind	O
of	O
object	O
.	O
</s>
<s>
Distributed	O
message	B-Architecture
passing	I-Architecture
provides	O
developers	O
with	O
a	O
layer	O
of	O
the	O
architecture	O
that	O
provides	O
common	O
services	O
to	O
build	O
systems	O
made	O
up	O
of	O
sub-systems	O
that	O
run	O
on	O
disparate	O
computers	O
in	O
different	O
locations	O
and	O
at	O
different	O
times	O
.	O
</s>
<s>
Finding	O
the	O
process	B-Operating_System
using	O
different	O
operating	O
systems	O
and	O
programming	O
languages	O
,	O
at	O
different	O
locations	O
from	O
where	O
the	O
message	O
originated	O
.	O
</s>
<s>
atomicity	B-General_Concept
,	O
consistency	B-General_Concept
,	O
isolation	B-General_Concept
,	O
durability	B-General_Concept
(	O
ACID	O
)	O
testing	O
the	O
data	O
.	O
</s>
<s>
Synchronous	O
message	B-Architecture
passing	I-Architecture
occurs	O
between	O
objects	O
that	O
are	O
running	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
It	O
is	O
used	O
by	O
object-oriented	B-Language
programming	I-Language
languages	I-Language
such	O
as	O
Java	B-Language
and	O
Smalltalk	B-Application
.	O
</s>
<s>
Synchronous	O
messaging	O
is	O
analogous	O
to	O
a	O
synchronous	O
function	O
call	O
;	O
just	O
as	O
the	O
function	O
caller	O
waits	O
until	O
the	O
function	O
completes	O
,	O
the	O
sending	O
process	B-Operating_System
waits	O
until	O
the	O
receiving	O
process	B-Operating_System
completes	O
.	O
</s>
<s>
For	O
example	O
,	O
large	O
,	O
distributed	B-Architecture
systems	I-Architecture
may	O
not	O
perform	O
well	O
enough	O
to	O
be	O
usable	O
.	O
</s>
<s>
Such	O
large	O
,	O
distributed	B-Architecture
systems	I-Architecture
may	O
need	O
to	O
operate	O
while	O
some	O
of	O
their	O
subsystems	O
are	O
down	O
for	O
maintenance	O
,	O
etc	O
.	O
</s>
<s>
Imagine	O
a	O
busy	O
business	O
office	O
having	O
100	O
desktop	O
computers	O
that	O
send	O
emails	O
to	O
each	O
other	O
using	O
synchronous	O
message	B-Architecture
passing	I-Architecture
exclusively	O
.	O
</s>
<s>
One	O
worker	O
turning	O
off	O
their	O
computer	O
can	O
cause	O
the	O
other	O
99	O
computers	O
to	O
freeze	O
until	O
the	O
worker	O
turns	O
their	O
computer	O
back	O
on	O
to	O
process	B-Operating_System
a	O
single	O
email	O
.	O
</s>
<s>
With	O
asynchronous	O
message	B-Architecture
passing	I-Architecture
the	O
receiving	O
object	O
can	O
be	O
down	O
or	O
busy	O
when	O
the	O
requesting	O
object	O
sends	O
the	O
message	O
.	O
</s>
<s>
Messages	O
are	O
sent	O
to	O
a	O
queue	O
where	O
they	O
are	O
stored	O
until	O
the	O
receiving	O
process	B-Operating_System
requests	O
them	O
.	O
</s>
<s>
The	O
receiving	O
process	B-Operating_System
processes	O
its	O
messages	O
and	O
sends	O
results	O
to	O
a	O
queue	O
for	O
pickup	O
by	O
the	O
original	O
process	B-Operating_System
(	O
or	O
some	O
designated	O
next	O
process	B-Operating_System
)	O
.	O
</s>
<s>
Asynchronous	O
messaging	O
requires	O
additional	O
capabilities	O
for	O
storing	O
and	O
retransmitting	O
data	O
for	O
systems	O
that	O
may	O
not	O
run	O
concurrently	O
,	O
and	O
are	O
generally	O
handled	O
by	O
an	O
intermediary	O
level	O
of	O
software	O
(	O
often	O
called	O
middleware	B-General_Concept
)	O
;	O
a	O
common	O
type	O
being	O
Message-oriented	O
middleware	B-General_Concept
(	O
MOM	O
)	O
.	O
</s>
<s>
A	O
blocked	O
sender	O
may	O
lead	O
to	O
deadlock	B-Operating_System
.	O
</s>
<s>
Synchronous	O
communication	O
can	O
be	O
built	O
on	O
top	O
of	O
asynchronous	O
communication	O
by	O
using	O
a	O
Synchronizer	B-Operating_System
.	O
</s>
<s>
For	O
example	O
,	O
the	O
α-Synchronizer	O
works	O
by	O
ensuring	O
that	O
the	O
sender	O
always	O
waits	O
for	O
an	O
acknowledgement	O
message	O
from	O
the	O
receiver	O
.	O
</s>
<s>
For	O
example	O
,	O
modern	O
microkernels	B-Operating_System
generally	O
only	O
provide	O
a	O
synchronous	O
messaging	O
primitive	O
and	O
asynchronous	O
messaging	O
can	O
be	O
implemented	O
on	O
top	O
by	O
using	O
helper	B-Operating_System
threads	I-Operating_System
.	O
</s>
<s>
Message-passing	B-Architecture
systems	O
use	O
either	O
distributed	O
or	O
local	O
objects	O
.	O
</s>
<s>
The	O
Remote	B-Operating_System
Procedure	I-Operating_System
Call	I-Operating_System
(	O
RPC	O
)	O
protocol	O
in	O
Unix	B-Application
was	O
an	O
early	O
example	O
of	O
this	O
.	O
</s>
<s>
Note	O
that	O
with	O
this	O
type	O
of	O
message	B-Architecture
passing	I-Architecture
it	O
is	O
not	O
a	O
requirement	O
that	O
sender	O
nor	O
receiver	O
use	O
object-oriented	B-Language
programming	I-Language
.	O
</s>
<s>
Examples	O
of	O
systems	O
that	O
support	O
distributed	O
objects	O
are	O
:	O
Emerald	B-Language
,	O
ONC	B-Protocol
RPC	I-Protocol
,	O
CORBA	B-Architecture
,	O
Java	B-Language
RMI	I-Language
,	O
DCOM	B-Operating_System
,	O
SOAP	B-Application
,	O
.NET	B-General_Concept
Remoting	I-General_Concept
,	O
CTOS	B-Operating_System
,	O
QNX	B-Operating_System
Neutrino	I-Operating_System
RTOS	I-Operating_System
,	O
OpenBinder	B-Operating_System
and	O
D-Bus	B-Language
.	O
</s>
<s>
Distributed	O
object	B-Language
systems	I-Language
have	O
been	O
called	O
"	O
shared	O
nothing	O
"	O
systems	O
because	O
the	O
message	B-Architecture
passing	I-Architecture
abstraction	O
hides	O
underlying	O
state	O
changes	O
that	O
may	O
be	O
used	O
in	O
the	O
implementation	O
of	O
sending	O
messages	O
.	O
</s>
<s>
Distributed	O
,	O
or	O
asynchronous	O
,	O
message-passing	B-Architecture
has	O
additional	O
overhead	O
compared	O
to	O
calling	O
a	O
procedure	O
.	O
</s>
<s>
In	O
message-passing	B-Architecture
,	O
arguments	O
must	O
be	O
copied	O
to	O
the	O
new	O
message	O
.	O
</s>
<s>
Traditional	O
procedure	O
calls	O
differ	O
from	O
message-passing	B-Architecture
in	O
terms	O
of	O
memory	O
usage	O
,	O
transfer	O
time	O
and	O
locality	O
.	O
</s>
<s>
Address-passing	O
is	O
not	O
possible	O
for	O
distributed	B-Architecture
systems	I-Architecture
since	O
the	O
systems	O
use	O
separate	O
address	O
spaces	O
.	O
</s>
<s>
Web	O
browsers	O
and	O
web	B-Application
servers	I-Application
are	O
examples	O
of	O
processes	O
that	O
communicate	O
by	O
message-passing	B-Architecture
.	O
</s>
<s>
A	O
URL	O
is	O
an	O
example	O
of	O
referencing	O
a	O
resource	O
without	O
exposing	O
process	B-Operating_System
internals	O
.	O
</s>
<s>
A	O
subroutine	O
call	O
or	O
method	B-Language
invocation	O
will	O
not	O
exit	O
until	O
the	O
invoked	O
computation	O
has	O
terminated	O
.	O
</s>
<s>
Asynchronous	O
message-passing	B-Architecture
,	O
by	O
contrast	O
,	O
can	O
result	O
in	O
a	O
response	O
arriving	O
a	O
significant	O
time	O
after	O
the	O
request	O
message	O
was	O
sent	O
.	O
</s>
<s>
A	O
message-handler	O
will	O
,	O
in	O
general	O
,	O
process	B-Operating_System
messages	O
from	O
more	O
than	O
one	O
sender	O
.	O
</s>
<s>
This	O
means	O
its	O
state	O
can	O
change	O
for	O
reasons	O
unrelated	O
to	O
the	O
behavior	O
of	O
a	O
single	O
sender	O
or	O
client	O
process	B-Operating_System
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
the	O
typical	O
behavior	O
of	O
an	O
object	O
upon	O
which	O
methods	O
are	O
being	O
invoked	O
:	O
the	O
latter	O
is	O
expected	O
to	O
remain	O
in	O
the	O
same	O
state	O
between	O
method	B-Language
invocations	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
message-handler	O
behaves	O
analogously	O
to	O
a	O
volatile	B-Operating_System
object	I-Operating_System
.	O
</s>
<s>
The	O
prominent	O
mathematical	O
models	O
of	O
message	B-Architecture
passing	I-Architecture
are	O
the	O
Actor	B-Application
model	I-Application
and	O
Pi	O
calculus	O
.	O
</s>
<s>
If	O
the	O
object	O
responds	O
to	O
the	O
message	O
,	O
it	O
has	O
a	O
method	B-Language
for	O
that	O
message	O
.	O
</s>
<s>
Alan	O
Kay	O
has	O
argued	O
that	O
message	B-Architecture
passing	I-Architecture
is	O
more	O
important	O
than	O
objects	O
in	O
OOP	O
,	O
and	O
that	O
objects	O
themselves	O
are	O
often	O
over-emphasized	O
.	O
</s>
<s>
The	O
live	B-Operating_System
distributed	I-Operating_System
objects	I-Operating_System
programming	O
model	O
builds	O
upon	O
this	O
observation	O
;	O
it	O
uses	O
the	O
concept	O
of	O
a	O
distributed	B-Operating_System
data	I-Operating_System
flow	I-Operating_System
to	O
characterize	O
the	O
behavior	O
of	O
a	O
complex	O
distributed	B-Architecture
system	I-Architecture
in	O
terms	O
of	O
message	B-Operating_System
patterns	I-Operating_System
,	O
using	O
high-level	O
,	O
functional-style	O
specifications	O
.	O
</s>
