<s>
In	O
distributed	B-Architecture
computing	I-Architecture
,	O
a	O
shared	O
snapshot	O
object	O
is	O
a	O
type	O
of	O
data	B-General_Concept
structure	I-General_Concept
,	O
which	O
is	O
shared	O
between	O
several	O
threads	B-Operating_System
or	O
processes	O
.	O
</s>
<s>
For	O
many	O
tasks	O
,	O
it	O
is	O
important	O
to	O
have	O
a	O
data	B-General_Concept
structure	I-General_Concept
,	O
that	O
can	O
provide	O
a	O
consistent	O
view	O
of	O
the	O
state	O
of	O
the	O
memory	O
.	O
</s>
<s>
In	O
practice	O
,	O
it	O
turns	O
out	O
that	O
it	O
is	O
not	O
possible	O
to	O
get	O
such	O
a	O
consistent	O
state	O
of	O
the	O
memory	O
by	O
just	O
accessing	O
one	O
shared	B-Operating_System
register	I-Operating_System
after	O
another	O
,	O
since	O
the	O
values	O
stored	O
in	O
individual	O
registers	B-Operating_System
can	O
be	O
changed	O
at	O
any	O
time	O
during	O
this	O
process	O
.	O
</s>
<s>
To	O
solve	O
this	O
problem	O
,	O
snapshot	O
objects	O
store	O
a	O
vector	O
of	O
n	O
components	O
and	O
provide	O
the	O
following	O
two	O
atomic	B-General_Concept
operations	I-General_Concept
:	O
update(i,v )	O
changes	O
the	O
value	O
in	O
the	O
ith	O
component	O
to	O
v	O
,	O
and	O
scan( )	O
returns	O
the	O
values	O
stored	O
in	O
all	O
n	O
components	O
.	O
</s>
<s>
Snapshot	O
objects	O
can	O
be	O
constructed	O
using	O
atomic	B-General_Concept
single-writer	O
multi-reader	O
shared	B-Operating_System
registers	I-Operating_System
.	O
</s>
<s>
A	O
shared	B-Operating_System
memory	I-Operating_System
is	O
partitioned	O
into	O
multiple	O
parts	O
.	O
</s>
<s>
More	O
generally	O
speaking	O
,	O
in	O
the	O
data	O
vector	O
each	O
entry	O
dk	O
corresponds	O
to	O
the	O
argument	O
of	O
the	O
last	O
linearized	B-General_Concept
update	O
operation	O
,	O
which	O
updates	O
part	O
k	O
of	O
the	O
memory	O
.	O
</s>
<s>
In	O
order	O
to	O
get	O
the	O
full	O
benefit	O
of	O
shared	B-Operating_System
snapshot	I-Operating_System
objects	I-Operating_System
,	O
in	O
terms	O
of	O
simplifications	O
for	O
validations	O
and	O
constructions	O
,	O
there	O
are	O
two	O
other	O
restrictions	O
added	O
to	O
the	O
construction	O
of	O
snapshot	O
objects	O
.	O
</s>
<s>
The	O
first	O
restriction	O
is	O
an	O
architectural	O
one	O
,	O
meaning	O
that	O
any	O
snapshot	O
object	O
is	O
constructed	O
only	O
with	O
single-writer	B-Operating_System
multi-reader	I-Operating_System
registers	I-Operating_System
as	O
the	O
basic	O
element	O
.	O
</s>
<s>
For	O
multi-writer	O
multi-reader	O
snapshot	O
objects	O
it	O
is	O
possible	O
to	O
use	O
multi-reader	B-Operating_System
multi-writer	I-Operating_System
registers	I-Operating_System
,	O
which	O
can	O
in	O
turn	O
be	O
constructed	O
from	O
single-writer	B-Operating_System
multi-reader	I-Operating_System
registers	I-Operating_System
.	O
</s>
<s>
In	O
distributed	B-Architecture
computing	I-Architecture
the	O
construction	O
of	O
a	O
system	O
is	O
driven	O
by	O
the	O
goal	O
,	O
that	O
the	O
whole	O
system	O
is	O
making	O
progress	O
during	O
the	O
execution	O
.	O
</s>
<s>
Several	O
methods	O
exists	O
to	O
implement	O
shared	B-Operating_System
snapshot	I-Operating_System
objects	I-Operating_System
.	O
</s>
<s>
It	O
guarantees	O
that	O
the	O
system	O
proceeds	O
,	O
while	O
individual	O
threads	B-Operating_System
can	O
starve	O
due	O
to	O
the	O
behaviour	O
of	O
individual	O
processes	O
.	O
</s>
<s>
Using	O
this	O
idea	O
one	O
can	O
construct	O
a	O
wait-free	O
algorithm	O
that	O
uses	O
registers	B-Operating_System
of	O
unbounded	O
size	O
.	O
</s>
<s>
The	O
basic	O
idea	O
is	O
that	O
if	O
a	O
process	O
sees	O
another	O
process	O
updating	O
a	O
memory	O
location	O
twice	O
,	O
that	O
process	O
must	O
have	O
executed	O
a	O
complete	O
,	O
linearized	B-General_Concept
,	O
update	O
operation	O
in	O
between	O
.	O
</s>
<s>
These	O
operations	O
can	O
be	O
linearized	B-General_Concept
by	O
linearizing	O
each	O
update( )	O
operation	O
at	O
its	O
write	O
to	O
the	O
register	O
.	O
</s>
<s>
If	O
the	O
double	O
collect	O
of	O
the	O
scan	O
operation	O
is	O
successful	O
the	O
scan	O
operation	O
can	O
be	O
linearized	B-General_Concept
at	O
the	O
end	O
of	O
the	O
second	O
scan	O
.	O
</s>
<s>
In	O
the	O
other	O
case	O
-	O
one	O
process	O
updated	O
its	O
register	O
two	O
times	O
-	O
the	O
operation	O
can	O
be	O
linearized	B-General_Concept
at	O
the	O
time	O
the	O
updating	O
process	O
collected	O
its	O
embedded	O
scan	O
before	O
writing	O
its	O
value	O
to	O
the	O
register	O
.	O
</s>
<s>
Every	O
pair	O
of	O
processes	O
communicates	O
using	O
two	O
single-writer	O
single-reader	O
(	O
swsr	O
)	O
registers	B-Operating_System
,	O
which	O
contains	O
two	O
atomic	B-General_Concept
bits	O
.	O
</s>
<s>
The	O
unbounded	O
sequence	O
number	O
is	O
replaced	O
by	O
two	O
handshake	B-Protocol
bits	O
for	O
every	O
pair	O
of	O
processes	O
.	O
</s>
<s>
These	O
handshake	B-Protocol
bits	O
are	O
based	O
on	O
swsr	O
registers	B-Operating_System
and	O
can	O
be	O
expressed	O
by	O
a	O
matrix	O
M	O
,	O
where	O
process	O
Pi	O
is	O
allowed	O
to	O
write	O
to	O
row	O
i	O
and	O
is	O
allowed	O
to	O
read	O
the	O
handshake	B-Protocol
bits	O
in	O
a	O
column	O
i	O
.	O
</s>
<s>
Before	O
the	O
scanning-process	O
performs	O
the	O
double-collect	O
it	O
collects	O
all	O
the	O
handshake	B-Protocol
bits	O
from	O
all	O
registers	B-Operating_System
,	O
by	O
reading	O
its	O
column	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
process	O
just	O
has	O
to	O
compare	O
the	O
column	O
again	O
with	O
the	O
initially	O
read	O
handshake	B-Protocol
bits	O
.	O
</s>
<s>
If	O
only	O
one	O
process	O
Pj	O
has	O
written	O
twice	O
,	O
during	O
the	O
collection	O
of	O
Pi	O
it	O
is	O
possible	O
that	O
the	O
handshake	B-Protocol
bits	O
do	O
not	O
change	O
during	O
the	O
scan	O
.	O
</s>
<s>
This	O
approach	O
allows	O
to	O
substitute	O
the	O
unbounded	O
sequence	O
numbers	O
with	O
the	O
handshake	B-Protocol
bits	O
,	O
without	O
changing	O
anything	O
else	O
in	O
the	O
scan	O
procedure	O
.	O
</s>
<s>
While	O
the	O
scanning	O
process	O
Pi	O
uses	O
a	O
handshake	B-Protocol
bit	O
to	O
detect	O
whether	O
it	O
can	O
use	O
its	O
double	O
collect	O
or	O
not	O
,	O
other	O
processes	O
may	O
also	O
perform	O
update	O
operations	O
.	O
</s>
<s>
As	O
a	O
first	O
step	O
,	O
they	O
read	O
again	O
the	O
handshake	B-Protocol
bits	O
provided	O
by	O
the	O
other	O
processes	O
,	O
and	O
generate	O
the	O
complement	O
of	O
them	O
.	O
</s>
<s>
Afterwards	O
these	O
processes	O
again	O
generate	O
the	O
embedded	O
scan	O
and	O
save	O
the	O
updated	O
data-value	O
,	O
the	O
collected	O
-	O
complemented	O
-	O
handshake	B-Protocol
bits	O
,	O
the	O
complemented	O
toggle	O
bit	O
and	O
the	O
embedded	O
scan	O
to	O
the	O
register	O
.	O
</s>
<s>
Since	O
the	O
handshake	B-Protocol
bits	O
equivalently	O
replace	O
the	O
sequence	O
numbers	O
,	O
the	O
linearization	B-General_Concept
is	O
the	O
same	O
as	O
in	O
the	O
unbounded	O
memory	O
case	O
.	O
</s>
<s>
The	O
construction	O
of	O
multi-writer	O
multi-reader	O
snapshot	O
object	O
assumes	O
that	O
n	O
processes	O
are	O
allowed	O
to	O
write	O
to	O
any	O
location	O
in	O
the	O
memory	O
,	O
which	O
consists	O
of	O
m	O
registers	B-Operating_System
.	O
</s>
<s>
Therefore	O
,	O
it	O
is	O
not	O
possible	O
anymore	O
to	O
couple	O
the	O
handshake	B-Protocol
bits	O
or	O
the	O
embedded	O
scan	O
with	O
the	O
data	O
fields	O
.	O
</s>
<s>
Hence	O
,	O
the	O
handshake	B-Protocol
bits	O
,	O
the	O
data	O
memory	O
and	O
the	O
embedded	O
scan	O
cannot	O
be	O
stored	O
in	O
the	O
same	O
register	O
and	O
the	O
write	O
to	O
the	O
memory	O
is	O
not	O
an	O
atomic	B-General_Concept
operation	I-General_Concept
anymore	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
update( )	O
process	O
has	O
to	O
update	O
three	O
different	O
registers	B-Operating_System
independently	O
.	O
</s>
<s>
It	O
first	O
has	O
to	O
save	O
the	O
handshake	B-Protocol
bits	O
it	O
reads	O
,	O
then	O
do	O
the	O
embedded	O
scan	O
and	O
finally	O
saves	O
its	O
value	O
to	O
the	O
designated	O
memory	O
position	O
.	O
</s>
<s>
It	O
is	O
not	O
sufficient	O
anymore	O
to	O
read	O
the	O
handshake	B-Protocol
bits	O
and	O
collect	O
the	O
memory	O
content	O
twice	O
.	O
</s>
<s>
In	O
order	O
to	O
detect	O
a	O
beginning	O
update	O
process	O
,	O
a	O
process	O
has	O
to	O
collect	O
the	O
handshake	B-Protocol
bits	O
a	O
second	O
time	O
,	O
after	O
collecting	O
the	O
memory	O
content	O
.	O
</s>
<s>
However	O
,	O
the	O
embedded	O
scan	O
of	O
this	O
write	O
is	O
performed	O
and	O
saved	O
,	O
before	O
P1	O
starts	O
scanning	O
the	O
memory	O
and	O
therefore	O
no	O
valid	O
Linearization	B-General_Concept
point	O
.	O
</s>
<s>
The	O
second	O
double-collect	O
fails	O
,	O
because	O
process	O
P2	O
starts	O
a	O
second	O
write	O
and	O
updated	O
its	O
handshake	B-Protocol
bits	O
.	O
</s>
<s>
In	O
the	O
mwmr	O
scenario	O
,	O
this	O
is	O
not	O
possible	O
because	O
the	O
embedded	O
scan	O
from	O
the	O
second	O
write	O
is	O
still	O
not	O
linearized	B-General_Concept
within	O
the	O
scan-interval	O
(	O
begin	O
and	O
end	O
of	O
operation	O
)	O
.	O
</s>
<s>
Thus	O
,	O
the	O
process	O
has	O
to	O
see	O
a	O
third	O
change	O
from	O
the	O
other	O
process	O
to	O
be	O
entirely	O
sure	O
that	O
at	O
least	O
one	O
embedded	O
scan	O
has	O
been	O
linearized	B-General_Concept
during	O
the	O
scan-interval	O
.	O
</s>
<s>
After	O
the	O
third	O
change	O
by	O
one	O
process	O
,	O
the	O
scanning	O
process	O
can	O
borrow	O
the	O
old	O
memory	O
value	O
without	O
violating	O
the	O
linearization	B-General_Concept
criterion	O
.	O
</s>
<s>
The	O
basic	O
presented	O
implementation	O
of	O
shared	B-Operating_System
snapshot	I-Operating_System
objects	I-Operating_System
by	O
Afek	O
et	O
al	O
.	O
</s>
<s>
There	O
are	O
also	O
randomized	O
implementations	O
of	O
snapshot	O
objects	O
based	O
on	O
swmr	O
registers	B-Operating_System
using	O
operations	O
.	O
</s>
<s>
Attiya	O
and	O
Rachman	O
present	O
a	O
deterministic	O
snapshot	O
algorithm	O
based	O
on	O
swmr	O
registers	B-Operating_System
,	O
which	O
uses	O
operations	O
per	O
update	O
and	O
scan	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
other	O
presented	O
methods	O
,	O
this	O
approach	O
uses	O
mwmr	O
registers	B-Operating_System
and	O
not	O
swmr	O
registers	B-Operating_System
.	O
</s>
<s>
There	O
are	O
several	O
algorithms	O
in	O
distributed	B-Architecture
computing	I-Architecture
which	O
can	O
be	O
simplified	O
in	O
design	O
and/or	O
verification	O
using	O
shared	B-Operating_System
snapshot	I-Operating_System
objects	I-Operating_System
.	O
</s>
<s>
Examples	O
of	O
this	O
are	O
exclusion	O
problems	O
,	O
concurrent	O
time-stamp	O
systems	O
,	O
approximate	O
agreement	O
,	O
randomized	O
consensus	O
and	O
wait-free	O
implementations	O
of	O
other	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
With	O
mwmr	O
snapshot	O
objects	O
it	O
is	O
also	O
possible	O
to	O
create	O
atomic	B-General_Concept
multi-writer	O
multi-reader	O
registers	B-Operating_System
.	O
</s>
