<s>
Causal	B-General_Concept
consistency	I-General_Concept
is	O
one	O
of	O
the	O
major	O
memory	B-General_Concept
consistency	I-General_Concept
models	I-General_Concept
.	O
</s>
<s>
In	O
concurrent	B-Architecture
programming	I-Architecture
,	O
where	O
concurrent	O
processes	O
are	O
accessing	O
a	O
shared	O
memory	O
,	O
a	O
consistency	B-General_Concept
model	I-General_Concept
restricts	O
which	O
accesses	O
are	O
legal	O
.	O
</s>
<s>
This	O
is	O
useful	O
for	O
defining	O
correct	O
data	B-General_Concept
structures	I-General_Concept
in	O
distributed	B-Operating_System
shared	I-Operating_System
memory	I-Operating_System
or	O
distributed	B-General_Concept
transactions	I-General_Concept
.	O
</s>
<s>
Causal	B-General_Concept
Consistency	I-General_Concept
is	O
“	B-Operating_System
Available	I-Operating_System
under	I-Operating_System
Partition	I-Operating_System
”	I-Operating_System
,	O
meaning	O
that	O
a	O
process	O
can	O
read	O
and	O
write	O
the	O
memory	O
(	O
memory	O
is	O
Available	O
)	O
even	O
while	O
there	O
is	O
no	O
functioning	O
network	O
connection	O
(	O
network	O
is	O
Partitioned	O
)	O
between	O
processes	O
;	O
it	O
is	O
an	O
asynchronous	O
model	O
.	O
</s>
<s>
Contrast	O
to	O
strong	O
consistency	B-General_Concept
models	I-General_Concept
,	O
such	O
as	O
sequential	B-General_Concept
consistency	I-General_Concept
or	O
linearizability	B-General_Concept
,	O
which	O
cannot	O
be	O
both	O
safe	B-Application
and	O
live	B-Application
under	O
partition	O
,	O
and	O
are	O
slow	O
to	O
respond	O
because	O
they	O
require	O
synchronisation	O
.	O
</s>
<s>
Causal	B-General_Concept
consistency	I-General_Concept
was	O
proposed	O
in	O
1990s	O
as	O
a	O
weaker	O
consistency	B-General_Concept
model	I-General_Concept
for	O
shared	O
memory	O
models	O
.	O
</s>
<s>
Causal	B-General_Concept
consistency	I-General_Concept
is	O
closely	O
related	O
to	O
the	O
concept	O
of	O
Causal	O
Broadcast	O
in	O
communication	O
protocols	O
.	O
</s>
<s>
In	O
these	O
models	O
,	O
a	O
distributed	O
execution	O
is	O
represented	O
as	O
a	O
partial	O
order	O
,	O
based	O
on	O
Lamport	O
's	O
happened-before	B-Operating_System
concept	O
of	O
potential	O
causality	O
.	O
</s>
<s>
Causal	B-General_Concept
consistency	I-General_Concept
is	O
a	O
useful	O
consistency	B-General_Concept
model	I-General_Concept
because	O
it	O
matches	O
programmers	O
 '	O
intuitions	O
about	O
time	O
,	O
is	O
more	O
available	O
than	O
strong	O
consistency	B-General_Concept
models	I-General_Concept
,	O
yet	O
provides	O
more	O
useful	O
guarantees	O
than	O
eventual	B-General_Concept
consistency	I-General_Concept
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
distributed	O
databases	O
,	O
causal	B-General_Concept
consistency	I-General_Concept
supports	O
the	O
ordering	O
of	O
operations	O
,	O
in	O
contrast	O
to	O
eventual	B-General_Concept
consistency	I-General_Concept
.	O
</s>
<s>
Also	O
,	O
causal	B-General_Concept
consistency	I-General_Concept
helps	O
with	O
the	O
development	O
of	O
abstract	O
data	O
types	O
such	O
as	O
queues	O
or	O
counters	O
.	O
</s>
<s>
to	O
reason	O
about	O
a	O
system	O
that	O
does	O
not	O
enforce	O
causal	B-General_Concept
consistency	I-General_Concept
.	O
</s>
<s>
Spanner	B-Operating_System
does	O
guarantee	O
causal	B-General_Concept
consistency	I-General_Concept
,	O
but	O
it	O
also	O
forces	O
strong	O
consistency	O
,	O
thus	O
eschewing	O
availability	B-Operating_System
under	I-Operating_System
partition	I-Operating_System
.	O
</s>
<s>
Causal	B-General_Concept
consistency	I-General_Concept
captures	O
the	O
potential	O
causal	O
relationships	O
between	O
operations	O
,	O
and	O
guarantees	O
that	O
all	O
processes	O
observe	O
causally-related	O
operations	O
in	O
a	O
common	O
order	O
.	O
</s>
<s>
Causal	B-General_Concept
Consistency	I-General_Concept
guarantees	O
that	O
if	O
A	O
causally-precedes	O
B	O
,	O
then	O
every	O
process	O
in	O
the	O
system	O
observes	O
A	O
before	O
observing	O
B	O
.	O
Conversely	O
,	O
two	O
write	O
operations	O
C	O
and	O
D	O
are	O
said	O
concurrent	O
,	O
or	O
causally	O
independent	O
,	O
if	O
neither	O
causally	O
precedes	O
the	O
other	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
a	O
process	O
may	O
observe	O
either	O
C	O
before	O
D	O
,	O
or	O
D	O
before	O
C	O
.	O
The	O
Causal	O
Precedence	O
relation	O
in	O
shared	O
memory	O
is	O
related	O
to	O
the	O
happened-before	B-Operating_System
relation	O
in	O
message-based	O
communication	O
.	O
</s>
<s>
Thus	O
,	O
a	O
system	O
provides	O
causal	B-General_Concept
consistency	I-General_Concept
if	O
this	O
following	O
condition	O
holds	O
:	O
write	O
operations	O
that	O
are	O
related	O
by	O
potential	O
causality	O
are	O
seen	O
by	O
each	O
process	O
of	O
the	O
system	O
in	O
their	O
causal	O
precedence	O
order	O
.	O
</s>
<s>
The	O
Causal	B-General_Concept
Consistency	I-General_Concept
model	O
is	O
weaker	O
than	O
sequential	B-General_Concept
consistency	I-General_Concept
,	O
which	O
ensures	O
that	O
all	O
processes	O
observe	O
all	O
write	O
operations	O
in	O
common	O
order	O
,	O
whether	O
causally	O
related	O
or	O
not	O
.	O
</s>
<s>
However	O
,	O
causal	B-General_Concept
consistency	I-General_Concept
is	O
stronger	O
than	O
PRAM	B-General_Concept
consistency	I-General_Concept
,	O
which	O
requires	O
only	O
the	O
write	O
operations	O
that	O
are	O
done	O
by	O
a	O
single	O
process	O
to	O
be	O
observed	O
in	O
common	O
order	O
by	O
each	O
other	O
process	O
.	O
</s>
<s>
It	O
follows	O
that	O
when	O
a	O
system	O
is	O
sequentially	B-General_Concept
consistent	I-General_Concept
,	O
it	O
is	O
also	O
causally	O
consistent	O
.	O
</s>
<s>
Additionally	O
,	O
causal	B-General_Concept
consistency	I-General_Concept
implies	O
PRAM	B-General_Concept
consistency	I-General_Concept
,	O
but	O
not	O
vice	O
versa	O
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
of	O
causal	B-General_Concept
consistency	I-General_Concept
.	O
</s>
<s>
Under	O
causal	B-General_Concept
consistency	I-General_Concept
,	O
every	O
process	O
observes	O
W(x )	O
1	O
first	O
,	O
before	O
observing	O
W(x )	O
2	O
.	O
</s>
<s>
The	O
causal	B-General_Concept
consistency	I-General_Concept
model	O
can	O
be	O
refined	O
into	O
four	O
session	O
guarantees	O
..	O
</s>
<s>
Because	O
of	O
concurrency	B-Architecture
and	O
failures	O
,	O
a	O
process	O
might	O
receive	O
events	O
in	O
any	O
order	O
.	O
</s>
<s>
This	O
approach	O
enables	O
availability	B-Operating_System
under	I-Operating_System
partition	I-Operating_System
.	O
</s>
<s>
The	O
other	O
is	O
to	O
maintain	O
a	O
vector	B-Operating_System
clock	I-Operating_System
,	O
with	O
one	O
entry	O
per	O
process	O
(	O
or	O
group	O
of	O
processes	O
)	O
,	O
counting	O
the	O
number	O
of	O
events	O
generated	O
by	O
the	O
process	O
or	O
group	O
.	O
</s>
<s>
However	O
,	O
a	O
precise	O
determination	O
of	O
concurrency	B-Architecture
is	O
generally	O
overkill	O
.	O
</s>
<s>
Causal	B-General_Concept
consistency	I-General_Concept
requires	O
only	O
that	O
causally-dependent	O
events	O
be	O
delivered	O
in	O
order	O
;	O
it	O
does	O
not	O
matter	O
if	O
two	O
concurrent	O
events	O
end	O
up	O
being	O
ordered	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
size	O
can	O
be	O
decreased	O
arbitrarily	O
by	O
using	O
safe	B-Application
approximation	O
techniques	O
.	O
</s>
<s>
In	O
the	O
limit	O
,	O
a	O
single	O
scalar	O
(	O
a	O
Lamport	O
clock	O
)	O
suffices	O
,	O
at	O
the	O
cost	O
of	O
removing	O
any	O
concurrency	B-Architecture
.	O
</s>
