Uncorrected Proof
2008-03-25
i i
Kao: Encyclopedia of Algorithms — Entry — // — : — page — LE-TEX
i i
i
i ii
Registers 1
Registers
1986; Lamport, Vitanyi, Awerbuch
1
Paul Vitányi
2
CWI, Amsterdam, Netherlands
3
Synonyms
4
Shared-memory (wait-free); Wait-free registers; Wait-free
5
shared variables; Asynchronous communication hard-
6
ware
7
Problem Definition
8
Consider a system of asynchronous processes that com-
9
municate among themselves by only executing read and
10
write operations on a set of shared variables (also known as
11
sharedregisters). The system has no global clock or other
12
synchronization primitives. Every shared variable is asso-
13
ciated with a process (calledowner) which writes it and the
14
other processes may read it. An execution of a write (read)
15
operation on a shared variable will be referred to as aWrite
16
(Read) on that variable. A Write on a shared variable puts
17
a value from a pre-determined finite domain into the vari-
18
able, and a Read reports a value from the domain. A process
19
that writes (reads) a variable is called awriter(reader) of the
20
variable.
21
The goal is to construct shared variables in which the
22
following two properties hold. () Operation executions are
23
not necessarily atomic, that is, they are not indivisible but
24
rather consist of atomic sub-operations, and () every op-
25
eration finishes its execution within a bounded number of
26
its own steps, irrespective of the presence of other oper-
27
ation executions and their relative speeds. That is, opera-
28
tion executions arewait-free. These two properties give rise
29
to a classification of shared variables, depending on their
30
output characteristics. Lamport [] distinguishes three cat-
31
egories for -writer shared variables, using a precedence re-
32
lation on operation executions defined as follows: for oper-
33
ation executionsAandB,A precedes B, denotedAB,
34
ifAfinishes beforeBstarts;AandB overlapif neitherA
35
precedesBnorBprecedesA. In -writer variables, all the
36
Writes are totally ordered by “”. The three categories of
37
-writer shared variables defined by Lamport are the fol-
38
lowing.
39
. A safe variable is one in which a Read not overlap-
40
ping any Write returns the most recently written value.
41
A Read that overlaps a Write may return any value from
42
the domain of the variable.
43
. Aregularvariable is a safe variable in which a Read that
44
overlaps one or more Writes returns either the value of
45
the most recent Write preceding the Read or of one of 46
the overlapping Writes. 47
. Anatomicvariable is a regular variable in which the 48 Reads and Writes behave as if they occur in some total 49 order which is an extension of the precedence relation. 50 A shared variable isbooleanormultivalueddepending 51 upon whether it can hold only two or more than two values. 52 Amultiwritershared variable is one that can be written and 53 read (concurrently) by many processes. If there is only one 54 writer and more than one reader it is called amultireader 55
variable. 56
Key Results 57
In a series of papers starting in , for details see [], 58 Lamport explored various notions of concurrent reading 59 and writing of shared variables culminating in the sem- 60 inal paper []. It formulates the notion of wait-free 61 implementation of an atomic multivalued shared vari- 62 able—written by a single writer and read by (another) 63 single reader—from safe -writer -reader -valued shared 64 variables, being mathematical versions of physical flip- 65 flops, later optimized in []. Lamport did not consider con- 66 structions of shared variables with more than one writer or 67
reader. 68
Predating the Lamport paper, in Peterson [] 69 published an ingenious wait-free construction of an atomic 70
-writer, n-reader m-valued atomic shared variable from 71 n+ safe -writern-readerm-valued registers, n-writer 72
-reader -valued atomic shared variables, and -writern- 73 reader -valued atomic shared variables. He presented also 74 a proper notion of the wait-freedom property. In his paper, 75 Peterson didn’t tell how to construct then-reader boolean 76 atomic variables from flip-flops, while Lamport mentioned 77 the open problem of doing so, and, incidentally, uses a ver- 78 sion of Peterson’s construction to bridge the algorithmi- 79 cally demanding step from atomic shared bits to atomic 80 shared multivalues. On the basis of this work, N. Lynch, 81 motivated by concurrency control of multi-user data-bases, 82 posed around the question of how to construct wait- 83 free multiwriter atomic variables from -writer multireader 84 atomic variables. Her student Bloom [] found in an 85 elegant -writer construction, which, however, has resisted 86 generalization to multiwriter. Vitányi and Awerbuch [] 87 were the first to define and explore the complicated notion 88 of wait-free constructions of general multiwriter atomic 89 variables, in . They presented a proof method, an un- 90 bounded solution from -writer -reader atomic variables, 91 and a bounded solution from -writern-reader atomic vari- 92 ables. The bounded solution turned out not to be atomic, 93
Boolean variables are referred to asbits.
Please note that the pagination is not final; in the print version an entry will in general not start on a new page.
Editor’s or typesetter’s annotations (will be removed before the final TEX run)
Uncorrected Proof
2008-03-25
i i
Kao: Encyclopedia of Algorithms — Entry — // — : — page — LE-TEX
i i
i
i ii
2
0
Registersbut only achieved regularity (“Errata” in []). The paper
94
introduced important notions and techniques in the area,
95
like (bounded) vector clocks, and identified open prob-
96
lems like the construction of atomic wait-free bounded
97
multireader shared variables from flip-flops, and atomic
98
wait-free bounded multiwriter shared variables from the
99
multireader ones. Peterson who had been working on the
100
multiwriter problem for a decade, together with Burns,
101
tried in to eliminate the error in the unbounded con-
102
struction of [] retaining the idea of vector clocks, but
103
replacing the obsolete-information tracking technique by
104
repeated scanning as in []. The result [] was found
105
to be erroneous in the technical report (R. Schaffer,
106
On the correctness of atomic multiwriter registers, Re-
107
port MIT/LCS/TM-, ). Neither the re-correction in
108
Schaffer’s Technical Report, nor the claimed re-correction
109
by the authors of [] has appeared in print. Also in
110
there appeared at least five purported solutions for the im-
111
plementation of -writern-reader atomic shared variable
112
from -writer -reader ones: [,,] (for the others see [])
113
of which [] was shown to be incorrect (S. Haldar, K.
114
Vidyasankar,ACM Oper. Syst. Rev, :(), –) and
115
only [] appeared in journal version. The paper [], ini-
116
tially a Harvard Tech Report, resolved all multiuser
117
constructions in one stroke: it constructs a bounded n-
118
writern-reader (multiwriter) atomic variable fromO(n)
119
-writer -reader safe bits, which is optimal, and O(n)
120
bit-accesses per Read/Write operation which is optimal as
121
well. It works by making the unbounded solution of []
122
bounded, using a new technique, achieving a robust proof
123
of correctness. “Projections” of the construction give spe-
124
cialized constructions for the implementation of -writern-
125
reader (multireader) atomic variables fromO(n) -writer
126
-reader ones usingO(n) bit accesses per Read/Write opera-
127
tion, and for the implementation ofn-writern-reader (mul-
128
tiwriter) atomic variables fromn-writern-reader (multi-
129
reader) ones. The first “projection” is optimal, while the last
130
“projection” may not be optimal since it usesO(n) control
131
bits per writer while only a lower bound ofΩ(logn)was es-
132
tablished. Taking up this challenge, the construction in []
133
claims to achieve this lower bound.
134
Timestamp System
135
In a multiwriter shared variable it is only required that ev-
136
ery process keeps track of which process wrote last. There
137
arises the general question whether every process can keep
138
track of the order of the last Writes by all processes. A.
139
Israeli and M. Li were attracted to the area by the work
140
in [], and, in an important paper [], they raised and
141
solved the question of the more general and universally
142
useful notion of a bounded timestamp system to track the 143 order of events in a concurrent system. In a timestamp sys- 144 tem every process owns anobject, an abstraction of a set 145 of shared variables. One of the requirements of the system 146 is to determine the temporal order in which the objects 147 are written. For this purpose, each object is given alabel 148 (also referred to as atimestamp) which indicates the lat- 149 est (relative) time when it has been written by its owner 150 process. The processes assign labels to their respective ob- 151 jects in such a way that the labels reflect the real-time or- 152 der in which they are written to. These systems must sup- 153 port two operations, namely labeling and scan. A label- 154 ing operation execution (Labeling, in short) assigns a new 155 label to an object, and a scan operation execution (Scan, 156 in short) enables a process to determine the ordering in 157 which all the objects are written, that is, it returns a set 158 of labeled-objects ordered temporally. The concern is with 159 those systems where operations can be executedconcur- 160 rently, in an overlapped fashion. Moreover, operation exe- 161 cutions must bewait-free, that is, each operation execution 162 will take a bounded number of its own steps (the number of 163 accesses to the shared space), irrespective of the presence of 164 other operation executions and their relative speeds. Israeli 165 and Li [] constructed a bit-optimal bounded timestamp 166 system forsequentialoperation executions. Their sequen- 167 tial timestamp system was published in the above jour- 168 nal reference, but the preliminary concurrent timestamp 169 system in the conference proceedings, of which a more 170 detailed version has been circulated in manuscript form, 171 has not been published in final form. The first generally 172 accepted solution of theconcurrentcase of the bounded 173 timestamp system was from Dolev and Shavit []. Their 174 construction is of the type presented in [] and uses shared 175 variables of sizeO(n), wherenis the number of processes 176 in the system. Each Labeling requiresO(n) steps, and each 177 ScanO(nlogn)steps. (A ‘step’ accesses anO(n) bit vari- 178 able.) In [] the unbounded construction of [] is cor- 179 rected and extended to obtain an efficient version of the 180 more general notion of a bounded concurrent timestamp 181
system. 182
Applications 183
Wait-free registers are, together with message-passing sys- 184 tems, the primary interprocess communication method in 185 distributed computing theory. They form the basis of all 186 constructions and protocols, as can be seen in the text- 187 books. Wait-free constructions of concurrent timestamp 188 systems (CTSs, in short) have been shown to be a pow- 189 erful tool for solving concurrency control problems such 190 as various types of mutual exclusion, multiwriter multi- 191
Uncorrected Proof
2008-03-25
i i
Kao: Encyclopedia of Algorithms — Entry — // — : — page — LE-TEX
i i
i
i ii
Registers 3
reader shared variables [], and probabilistic consensus,
192
by synthesizing a “wait-free clock” to sequence the actions
193
in a concurrent system. For more details see [].
194
Open Problems
195
There is a great deal of work in the direction of register con-
196
structions that use less constituent parts, or simpler parts,
197
or parts that can tolerate more complex failures, than pre-
198
vious constructions referred to above. Only, of course, if
199
the latter constructions were not yet optimal in the param-
200
eter concerned. Further directions are work on wait-free
201
higher-typed objects, as mentioned above, hierarchies of
202
such objects, and probabilistic constructions. This litera-
203
ture is too vast and diverse to be surveyed here.
204
Experimental Results
205
Register constructions, or related constructions for asyn-
206
chronous interprocess communication, are used in current
207
hardware and software.
208
Cross References
209
Asynchronous Consensus Impossibility
210
Atomic Broadcast
211
Causal Order, Logical Clocks, State Machine
212
Replication
213
Concurrent Programming
214
Emulating Shared-Memory in Message-Passing Systems
215
Linearizability
216
Renaming
217
Self-Stabilization
218
Snapshots in Shared-Memory
219
Synchronizers, Spanners
220
Topology Approach in Distributed Computing
221
Wait-Free Computation
222
Recommended Reading
223
1. Bloom, B.: Constructing two-writer atomic registers. IEEE Trans.
224
Comput. 37(12), 1506–1514 (1988)
225
2. Burns, J.E., Peterson, G.L.: Constructing multi-reader atomic
226
values from non-atomic values. In: Proc. 6th ACM Symp. Princi-
227
ples Distr. Comput., pp. 222–231. CE2(1987)
228
3. Dolev, D., Shavit, N.: Bounded concurrent time-stamp systems
229
are constructible. Siam J. Comput. 26(2), 418–455 (1997)
230
4. Haldar, S., Vitanyi, P.: Bounded concurrent timestamp systems
231
using vector clocks. J. Assoc. Comp. Mach. 49(1), 101–126
232
(2002)
233
5. Israeli, A., Li, M.: Bounded time-stamps. Distribut. Comput. 6,
234
205–209 (1993) (Preliminary, more extended, version in: Proc.
235
28th IEEE Symp. Found. Comput. Sci., pp. 371–382, 1987.)
236
6. Israeli, A., Shaham, A.: Optimal multi-writer multireader atomic 237
register. In: Proc. 11th ACM Symp. Principles Distr. Comput., 238
pp. 71–82.CE2(1992) 239
7. Kirousis, L.M., Kranakis, E., Vitányi, P.M.B.: Atomic multireader 240
register. In: Proc. Workshop Distributed Algorithms. Lect Notes 241
Comput Sci, vol 312, pp. 278–296. Springer, Berlin (1987) 242
8. Lamport, L.: On interprocess communication—Part I: Basic 243
formalism, Part II: Algorithms. Distrib. Comput. 1(2), 77–101 244
(1986) 245
9. Li, M., Tromp, J., Vitányi, P.M.B.: How to share concurrent wait- 246
free variables. J. ACM 43(4), 723–746 (1996) (Preliminary ver- 247
sion: Li, M., Vitányi, P.M.B. A very simple construction for atomic 248
multiwriter register. Tech. Rept. TR-01–87, Computer Science 249
Dept., Harvard University, Nov. 1987) 250
10. Peterson, G.L.: Concurrent reading while writing. ACM Trans. 251
Program. Lang. Syst. 5(1), 56–65 (1983) 252
11. Peterson, G.L., Burns, J.E.: Concurrent reading while writing II: 253
The multiwriter case. In: Proc. 28th IEEE Symp. Found. Comput. 254
Sci., pp. 383–392.CE2(1987) 255
12. Singh, A.K., Anderson, J.H., Gouda, M.G.: The elusive atomic 256
register. J. ACM 41(2), 311–339 (1994) (Preliminary version in: 257
Proc. 6th ACM Symp. Principles Distribt. Comput., 1987) 258
13. Tromp, J.: How to construct an atomic variable. In: Proc. Work- 259
shop Distrib. Algorithms. Lecture Notes in Computer Science, 260
vol. 392, pp. 292–302. Springer, Berlin (1989) 261
14. Vitányi, P.M.B., Awerbuch, B.: Atomic shared register access 262
by asynchronous hardware. In: Proc. 27th IEEE Symp. Found. 263
Comput. Sci. pp. 233–243. Errata, Proc. 28th IEEE Symp. Found. 264
Comput. Sci., pp. 487–487.CE2(1986) 265
CE Please provide date and location of the symposium.
Editor’s or typesetter’s annotations (will be removed before the final TEX run)