A Note on the Homotopy Type of Wait-free Atomic

11 downloads 0 Views 154KB Size Report
by crashing. It is shown that in this model, a wait-free, full-information protocol ... Keywords: wait-free computing, atomic snapshots, simplicial complexes, homo-.
A Note on the Homotopy Type of Wait-free Atomic Snapshot Protocol Complexes John Havlicek University of Texas at Austin [email protected] Abstract

In the atomic snapshot system model, the processes of an asynchronous distributed system communicate by atomic write and atomic snapshot read operations on a shared memory consisting of single-writer, multiple-reader registers. The processes may fail by crashing. It is shown that in this model, a wait-free, full-information protocol complex is homotopy equivalent to the underlying input complex. A span in the sense of Herlihy and Shavit provides the homotopy equivalence. It follows that the protocol complex and the input complex are indistinguishable by ordinary homology or homotopy groups.

AMS Subjects: 68Q22, 55P10. Keywords: wait-free computing, atomic snapshots, simplicial complexes, homotopy equivalence. Running title: Atomic snapshot protocol complexes.

1. Introduction Consider an asynchronous distributed system of n + 1 processes that interact via shared objects, and assume that processes may fail by crashing. Coordination problems, such as consensus and its generalizations{known as decision tasks {are fundamental to computation in such a system. A basic question of fault-tolerant computability in the system is whether a given decision task can be solved despite failure by various numbers of the constituent processes. A protocol that solves a decision task regardless of any pattern of failures by up to f processes is called f -resilient , and a protocol that is n-resilient is said to be wait-free . In this note, we restrict attention to wait-free computation by deterministic protocols. By using Borowsky-Gafni simulation [BG2, B, LR], the question of f -resilient solvability of a decision task can in many cases be reduced to the question of waitfree solvability of essentially the same task in a smaller system. Thus, the theory of wait-free computation is of considerable signi cance. It has been well established that insight into wait-free solvability of decision tasks is gained by introducing certain simplicial complexes and using standard techniques for studying their combinatorial and topological structure. See [HR] for a good introduction to this area of research. Simplicial complexes are associated to the inputs

1

and outputs of the task, and recent work [H] shows that it is also possible to de ne a simplicial complex representing the task relation. If a protocol is wait-free on an input complex, then there is an associated protocol complex, which is a geometric representation of the various possible executions of the protocol. The general structure of the protocol complex depends on the system model and is especially sensitive to the kinds of shared objects that are available. The success of the entire approach hinges on the fact that the topology of the simplicial complexes is computationally signi cant. Indeed, the combinatorial and topological relationships between the various complexes convey critical information about the solvability of the task and, if solvable, about the complexity of solution. A typical system model in this line of research has a foundation of single-writer, multiple-reader shared-memory registers. More sophisticated shared objects, such as (m; k)-consensus objects, may be added, signi cantly increasing the computational power of the system. For this note, however, we are interested in the underlying shared-memory register system. In addition to atomic writes, the system is assumed, without loss of generality [Af+], to provide atomic snapshot reads for accessing shared memory. This basic system will be referred to as the atomic snapshot (AS) system model. In order to maximize computational power in the model, it is generally assumed that protocols are structured to record full information. This means that each process accumulates locally a view (i.e., history) of the computation and maintains a copy of this view in shared memory. When a process reads, it appends the snapshot of the entire shared memory to its local view; and when a process writes, the value written is simply the current view of the process. It is not dicult to see that any other value that one might desire the process to write can be inferred from the view. Several variations on the AS system model have been proposed. [BG1] introduces the immediate snapshot (IS) system model, whose executions are a strict subset of the AS executions. In the IS model, the individual write and read operations are fused into a single WriteRead operation. A set of processes may execute concurrent WriteRead operations, the e ect being equivalent to an AS execution in which the processes of the set perform concurrent writes and then immediately perform concurrent snapshot reads. Another alternative is the iterated immediate snapshot (IIS) system model [B, BG3, HoS]. For the IIS system model, shared memory is divided into disjoint regions. One region is used for each immediate snapshot of the system. When a process executes its kth WriteRead operation, it writes a value into its single-writer portion of the kth memory region, and an immediate atomic snapshot of the kth memory region (only) is returned to the process. This snapshot value is then the value to be written by the process in the (k + 1)th WriteRead operation. It is known [BG3] that the AS, IS, and IIS system models are all computationally equivalent for wait-free solution of decision tasks. In other words, a decision task is wait-free solvable in one of the system models if and only if it is wait-free solvable in all three. But the protocol complexes that arise from the di erent models are structurally distinct. The IIS system model is the most restrictive. As a result the associated protocol complexes have the simplest structure. If a protocol is normalized so that each process is directed to execute the same number of WriteRead operations (i.e., there is no early stopping), then the protocol complex is an iterated standard chromatic 2

subdivision of the complex of input values [B, BG3, HS2]. Without normalization, the protocol complex is a non-uniform chromatic subdivision of the input complex [HoS]. In any case, an IIS protocol complex is homeomorphic to (i.e., of the same topological type as) the input complex. It has been claimed [BG3, p. 197] that protocol complexes in the IS system model are also chromatic subdivisions of the underlying input complexes, although no published proof or counterexample is known to the author. Assuming validity of the claim, the IS protocol complex is again homeomorphic to the input complex. The purpose of this note is to clarify the structure of wait-free full-information protocol complexes in the AS system model. An AS protocol complex is not generally homeomorphic to the underlying input complex. Nevertheless, an AS protocol complex is equivalent to the input complex in a weaker topological sense. In this note we show that a wait-free, full-information AS protocol complex is homotopy equivalent to (i.e., of the same homotopy type as) the underlying input complex. In fact, a span in the sense of Herlihy and Shavit provides the homotopy equivalence. Loosely speaking, homotopy equivalence is equivalence up to continuous deformation. It is a common notion in algebraic topology since homeomorphism tends to be too restrictive for useful classi cation. Important standard functors, such as the ordinary homology and homotopy group functors, do not di erentiate between spaces of the same homotopy type. Thus, from the point of view of homology or homotopy groups, a wait-free AS protocol complex is indistinguishable from the underlying input complex. The fact that a wait-free AS protocol complex is homotopy equivalent to the underlying input complex gives an intuitive explanation for why the Asynchronous Computability Theorem [HS2, HS3] works. Roughly speaking, the protocol complex holds computational information in topological form, and all of the topological structure of the protocol complex exists, up to homotopy equivalence, in the input complex. A span simply makes the translation between the two. The homotopy equivalence also clari es the basis of the obstruction method introduced in [H] for detecting impossibility of solution of decision tasks. The obstruction method relies on the fact that a span admits a left homotopy inverse, and this note shows that the left homotopy inverse can be arranged as a two-sided homotopy inverse. 2. Preliminaries and Notation It is assumed that the reader is generally familiar with the use of simplicial complexes in the study of wait-free solvability of decision tasks. [HR] provides a good introduction to this area of research, while [Mu] and [S] are standard references for algebraic topology.

2.1 Simplexes and complexes.

If A is an abstract simplicial complex, then jAj denotes its polyhedron. Strictly speaking, A is a combinatorial object, while jAj is an associated topological space. If f : A ! B is a simplicial map of simplicial complexes, then jf j : jAj ! jBj denotes the associated piecewise-linear map between the polyhedra. A(k) denotes the kskeleton of A, which is the subcomplex consisting of simplexes of A of dimension  k. If (A) is a subdivision of A and S is a simplex of (A), then carrier(S ) denotes the smallest simplex of A whose polyhedron contains jS j. If A is a simplex, then @A denotes its boundary. 3

An input pair is an ordered pair (p; v), where p is a process identi er and v is an input value. If x = (p; v), then we write id(x) = p and val(x) = v. A non-empty set X = fx0 ; : : : ; xr g of input pairs forms an input simplex provided id(x0 ); : : : ; id(xr ) are distinct. In this case, X is an r-dimensional chromatic simplex with coloring x 7! id(x). We write ids(X ) = fid(x0 ); : : : ; id(xr )g. A set K of input simplexes is an input complex provided it satis es the usual hereditary property of simplicial complexes: if X 2 K and X 0 is a non-empty subset of X , then X 0 2 K. As a protocol executes, each process accumulates its local view of the computation. We assume that a process' view begins with its input value, and therefore in the rst write operation the process copies its input value to shared memory. The view continues, according to full information, with the sequence of snapshots of shared memory witnessed by the process. If a process completes the protocol, then its view at halting is its nal view in the execution. A protocol pair is an ordered pair z = (p; w), where p is a process identi er and w is the nal view accumulated by p in some execution of the protocol. We write id(z ) = p and view(z ) = w. Also, inval(z ) denotes the input value for p in the execution, which appears at the beginning of w. A non-empty set Z = fz0 ; : : : ; zr g of protocol pairs forms a protocol simplex provided there is a single execution e of the protocol such that, for each j = 0; : : : ; r, process id(zj ) accumulates nal view view(zj ) in e. In this case, we say that e certi es Z . We write ids(Z ) = fid(z0 ); : : : ; id(zr )g. If z is a protocol pair, then input pairs other than (id(z ); inval(z )) may be determined from z . This is because the snapshots in view(z ) may witness the input values copied by other processes into shared memory. By X (z ), we mean the input simplex consisting of all input pairs that can be determined in this fashion from z . If Z is a protocol simplex, then

X (Z ) =

[ X (z) :

z2Z

There is a chromatic simplicial map : Z ! X (Z ) de ned by z 7! (id(z ); inval(z )). Consider a full-information AS protocol that is wait-free on the input simplex X . By P (X ) we mean the protocol complex of all protocol simplexes that can be certi ed by executions with X as input simplex: P (X ) = fZ : X (Z )  X g : If K is an input complex on which the protocol is wait-free, then P (K) is the union of the complexes P (X ) as X ranges over the various input simplexes of K. In this case, there is a chromatic simplicial map : P (K) ! K de ned as above.

2.2 Homotopy.

By map we mean a continuous function. Let X and Y be spaces, and let f; g : X ! Y be maps. A homotopy from f to g is a map F : X  [0; 1] ! Y that satis es F (?; 0) = f and F (?; 1) = g : In other words, when suitably identifying the ends of the cylinder X  [0; 1] with X , the restriction of F to one end gives the map f , and the restriction of F to the other 4

end gives g. Furthermore, the restriction of F to the cross section X  ftg gives a map F (?; t): X ! Y . Continuity of F on the cylinder ensures that, as t moves from 0 to 1, F (?; t) \deforms continuously" from f to g. If there is a homotopy from f to g, then f and g are said to be homotopic . Example 2.2.1: Let X and Y be non-empty spaces with Y convex, and let f; g : X ! Y be any maps. De ne F : X  [0; 1] ! Y by

F (x; t) = (1 ? t)f (x) + tg(x) : F is into Y because (1 ? t)f (x) + tg(x) parameterizes the line segment [f (x); g(x)], which lies in Y by convexity. The continuity of f and g ensures that F is continuous. Thus, f and g are homotopic. F is often referred to as the straight-line homotopy between f and g. It may be possible to form a straight-line homotopy even if Y is not convex. It is required only that the line segment [f (x); g(x)] be contained in Y for every x 2 X . If f : X ! Y and g : Y ! X are maps such that f  g is homotopic to the identity map of Y , then g is called a right homotopy inverse for f , and if g  f is homotopic to the identity map of X , then g is called a left homotopy inverse for f . If g is both a left and right homotopy inverse for f , then the same is true of f for g. In this case, f and g are called homotopy inverses of one another; each of f and g is said to be a homotopy equivalence ; and the spaces X and Y are said to be homotopy

equivalent . A space X is contractible if it is homotopy equivalent to a one-point space. Any non-empty convex set is contractible, and thus the polyhedron of any simplex is contractible. A map f : X ! Y is called null-homotopic if f is homotopic to a constant map. Any map from a non-empty space to a contractible space is nullhomotopic. The following extension property is well known. Proposition 2.2.2: Let X be homeomorphic to a closed disk, let @X be the boundary sphere of X , and let Y be a non-empty space. A map f : @X ! Y can be extended to a map X ! Y if and only if f is null-homotopic. Note that if A is a simplex, then Proposition 2.2.2 can be applied with X = jAj and @X = j@Aj. Since j@Aj has a collar neighborhood in jAj, one has the following special case of the Simplicial Approximation Theorem. Proposition 2.2.3: Let A be a simplex, let 0 (@A) be a subdivision of its boundary, and let B be a simplicial complex. Suppose that there is a simplicial map '0 : 0 (@A) ! B. If j'0 j is null-homotopic, then there is a subdivision (A) and there is a simplicial map ' : (A) ! B such that (@A) = 0 (@A) and the restriction of ' to (@A) equals '0 . The next result is fundamental and lies at the heart of the Asynchronous Computability Theorem of Herlihy and Shavit. It can be proved by generalizing the critical state technique from the seminal paper [FLP] of Fischer, Lynch, and Paterson. Contractibility Theorem 2.2.4 ([HS1]): Assume that an AS protocol records full information, and let X be an input simplex on which the protocol is wait-free. Then jP (X )j is contractible.

5

In [HS3], Herlihy and Shavit actually prove that jP (X )j has trivial fundamental group and trivial reduced homology groups in all dimensions. The Theorem of Whitehead [S, p. 399] and standard homotopy theory [S, pp. 405{406] imply that these conditions are equivalent to contractibility of jP (X )j. 3. Wait-free AS Protocol Complexes Consider a full-information AS protocol that is wait-free on the input complex K. We will show in Theorem 3.2.2 that the map

j j : jP (K)j ! jKj is a homotopy equivalence. A suitable homotopy inverse for j j is j'j, where ' : (K) ! P (K) is any span in the sense of Herlihy and Shavit. One could simply cite the existence of spans from [HS3], but the condition that ' be chromatic is not needed in the present context. In [HS3], most of the technical work to prove the existence of spans is concerned with arranging the chromatic condition. To avoid assuming these arguments, we review in Subsection 3.1 the simple proof of the existence of \non-chromatic" spans that appears in [HS3]. This argument also serves as a model for the proof of Theorem 3.2.2.

3.1 Non-chromatic spans.

A non-chromatic span (for the protocol on K) is a simplicial map ' from a subdivision (K) of K to P (K) such that, for any simplex S of (K), '(S ) 2 P (carrier(S )). It is worth noting that if ' : (K) ! P (K) is a non-chromatic span and if L is a subcomplex of K, then the restriction of ' to (L) is a non-chromatic span for the protocol on L. Theorem 3.1.1 ([HS3]): Assume that an AS protocol records full information, and let K be an input complex on which the protocol is wait-free. Then there exists a non-chromatic span for the protocol on K. Proof: We construct the subdivision (K) and the map ' inductively on the skeleta of K. The 0-skeleton of K admits no subdivision. Let x be a vertex of K, and let p = id(x). Since the protocol is wait-free, there is a nite execution e in which p starts with input value val(x) and only p has events. Let z = (p; w), where w is the nal view of p in e. Then P (fxg) has only the single vertex z . We must, therefore, let '(x) = z . This de nes ' as a non-chromatic span for the protocol on K(0) . Assume now that k > 0, that the subdivision (K(k?1) ) has been de ned, and that ' has been de ned as a non-chromatic span for the protocol on K(k?1) . Let X be a k-simplex of K. The boundary @X is contained in K(k?1) , so ' gives a simplicial map (@X ) ! P (X ). According to the Contractibility Theorem, jP (X )j is contractible, and so the restriction of j'j to j@X j is null-homotopic. By Proposition 2.2.3, the subdivision (@X ) can be extended to a subdivision (X ) and ' can be extended to a simplicial map (X ) ! P (X ). In this way, we de ne the subdivision (K(k) ) and the map ' : (K(k) ) ! P (K(k) ). Suppose that S is simplex of (K(k) ). If S lies in (K(k?1) ), then '(S ) 2 P (carrier(S )) by the inductive hypothesis. Otherwise, carrier(S ) is a k-simplex of K, say X . From our construction, we see that ' maps S into P (X ) = P (carrier(S )). This veri es that ' is a non-chromatic span for the protocol on K(k) and completes the inductive step. 6

3.2 Homotopy type of wait-free AS protocol complexes.

In this subsection, we show that jKj and jP (K)j are homotopy equivalent spaces. According to Theorem 3.1.1, there is a non-chromatic span ' : (K) ! P (K). We rst show that j'j is a right homotopy inverse for j j. Proposition 3.2.1: j j  j'j is homotopic to the identity map of jKj. Proof: Without loss of generality, jKj = j(K)j. For any simplex S in (K),  '(S )  carrier(S ) : Since jS j  jcarrier(S )j and since jcarrier(S )j is convex, we can form a straight-line homotopy between j j  j'j and the identity map of jKj. Theorem 3.2.2: Assume that an AS protocol records full information. Let K be an input complex on which the protocol is wait-free, and let ' : (K) ! P (K) be a non-chromatic span. Then j'j and j j are homotopy inverses, and so jP (K)j and jKj are homotopy equivalent. Proof: From Proposition 3.2.1 we have that j j  j'j is homotopic to the identity map of jKj. We now construct a homotopy F : jP (K)j  [0; 1] ! jP (K)j from j'j  j j to the identity map of jP (K)j by induction on the skeleta of P (K). F will be arranged to satisfy the following property: () If X 2 K and Z 2 P (X ), then F (jZ j  [0; 1])  jP (X )j. Let z be a vertex of P (K), and let X = X (z ). Note that X is the minimal simplex of K such that z is a vertex of P (X ). Then (z ) is a vertex of X , and thus '  (z ) is a vertex of P (X ). Since jP (X )j is contractible, there is a path in jP (X )j from jz j to j'j  j j(jz j). This path de nes F on jz j  [0; 1], and combining these paths de nes F on jP (K)(0) j  [0; 1]. Property () is satis ed for vertices z 2 P (K)(0) because X was chosen to be minimal for the property z 2 P (X ). Now let k > 0, and assume that F has been de ned on jP (K)(k?1) j  [0; 1] and satis es () for protocol simplexes in P (K)(k?1) . Let Z be a k-simplex of P (K), and let X = X (Z ). Again, X is the minimal simplex of K such that Z 2 P (X ). Let  = jZ j  f0g [ j@Z j  [0; 1] [ jZ j  f1g : Notice that  is the boundary of the closed (k + 1)-disk jZ j  [0; 1], hence  is a k-sphere. By the inductive hypothesis, F is already de ned on j@Z j  [0; 1] and satis es F (j@Z j  [0; 1])  jP (X )j : We have (Z )  X , hence j'j  j j(jZ j)  jP (X )j, and so we let F (x; 0) = j'j  j j(x) for x 2 jZ j. Also, we let F (?; 1) be the identity map of jZ j. These de nitions of F cohere to give a map  ! jP (X )j. Since jP (X )j is contractible, Proposition 2.2.2 implies that F can be extended to a map of the disk jZ j  [0; 1] ! jP (X )j. Combining these extensions for the various k-simplexes of P (K) gives the extension of F to jP (K)(k) j [0; 1]. Again, property () is satis ed for simplexes Z 2 P (K)(k) because X was chosen to be minimal for the property Z 2 P (X ). 7

[Af+] [B] [BG1] [BG2] [BG3] [FLP] [H] [HR] [HS1] [HS2] [HS3] [HoS] [LR] [Mu] [S]

References Y. Afek, H. Attiya, D. Dolev, E. Gafni, M. Merritt, and N. Shavit, Atomic snapshots of shared memory, Journal of the ACM 40(4), 1993, pp. 873{890. E. Borowsky, Capturing the power of resiliency and set consensus in distributed systems, Ph.D. Thesis, UCLA, 1995. E. Borowsky and E. Gafni, Immediate atomic snapshots and fast renaming, Proc. 12th ACM Symp. PODC, 1993, pp. 41{51. E. Borowsky and E. Gafni, Generalized FLP impossibility result for tresilient asynchronous computations, Proc. 25th ACM STOC, 1993, pp. 91{ 100. E. Borowsky and E. Gafni, A simple algorithmically reasoned characterization of wait-free computations, Proc. 16th ACM Symp. PODC, 1997, pp. 189{198. M. Fischer, N. Lynch, and M. Paterson, Impossibility of distributed consensus with one faulty process, Journal of the ACM 32(2), 1985, pp. 374{382. J. Havlicek, Computable obstructions to wait-free computability, Proc. 38th IEEE Symp. FOCS, 1997, pp. 80{89. M. Herlihy and S. Rajsbaum, A primer on algebraic topology and distributed computing, in Computer Science Today , Jan van Leeuwen (ed.), Lecture Notes in Computer Science, vol. 1000, Springer, pp. 203{217. M. Herlihy and N. Shavit, The asynchronous computability theorem for t-resilient tasks, Proc. 25th ACM STOC, 1993, pp. 111{120. M. Herlihy and N. Shavit, A simple constructive computability theorem for wait-free computation, Proc. 26th ACM STOC, 1994, pp. 101{110. M. Herlihy and N. Shavit, The topological structure of asynchronous computability, Technical Report TR CS-96-03, Brown University, 1996. G. Hoest and N. Shavit, Towards a topological characterization of asynchronous complexity, Proc. 16th ACM Symp. PODC, 1997, pp. 199{208. N. Lynch and S. Rajsbaum, On the Borowsky-Gafni simulation algorithm brief announcement, Proc. 15th ACM Symp. PODC, 1996, p. 57. J. Munkres, Elements of Algebraic Topology, Addison-Wesley, 1984. E. Spanier, Algebraic Topology, McGraw-Hill, 1966; Springer, 1982.

8