topology and distributed computing - brown universitycs.brown.edu/~mph/finland.pdf · making sure...

57
Topology and Distributed Computing Maurice Herlihy Brown University Nir Shavit Sun Microsystems & Tel Aviv U.

Upload: others

Post on 10-Aug-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

Topology and Distributed ComputingMaurice HerlihyBrown University

Nir ShavitSun Microsystems & Tel Aviv U.

Page 2: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 2

From the New York Times …SAN FRANCISCO, May 7 - Intel said on Friday that it was scrapping its development of two microprocessors, a move that is a shift in the company's business strategy….

Page 3: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 3

The NYT Continues …Intel … [has] decided to focus its development efforts on “dual core” processors …. with two engines instead of one, allowing for greater efficiency because the processor workload is essentially shared.

NYT 8 May 2004

Page 4: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 4

The Future of Computing

• Speeding up uniprocessors is harder and harder

• Intel, Sun, AMD now focusing on “multi-core” architectures

• Soon, every computer will be a multiprocessor

Page 5: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 5

What does this have to do with Theory?

Alan Mathison Turing. Inventor of the Turing Machine.

Page 6: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 6

Turing Computability

• Mathematical model of computation• What is (and is not) computable on

uniprocessors

0 1 1 0 1 01

Page 7: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 7

Time and Asynchrony

“Time is Nature’s way of making sure that everything doesn’t happen all at once.”(Anonymous, circa 1970)

Real world asynchrony: no clock in the sky

Page 8: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 8

Asynchronous Computability?

• Mathematical model of asynchronouscomputation

• What is (and is not) asynchronously computable

1001110011

Shared Memory

Page 9: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 9

Asynchrony Complicates Life

A multitude of concurrent executions

Asynchrony

Synchrony

Seek help from modern mathematics!

A single execution

Page 10: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 10

FLP

• Fischer Lynch Paterson• Showed that asynchronous

computability ≠ Turing computability• Consensus

– Trivial in uniprocessor– Impossible with 1 asynchronous failure

• Reasoned directly about executions

Page 11: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 11

Graph Theory

• Biran, Moran, Zachs 1988• Single asynchronous failure• Coordination problem

– is a graph• Problem is asynchronously computable

– iff graph is connected

Page 12: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 12

More Graph Theory

• Fischer Lynch 82, Dolev Strong 83, Merritt 85, Dwork Moses 90, …

• Synchronous crash failures• Computation state

– is a graph• Consensus not asynchronously

computable– while graph is connected

Page 13: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 13

Limitations of Graph Theory

• Asynchronous model– Multiple failures?

• Synchronous model– Problems beyond consensus?

• Need a more general notion of connectivity

Page 14: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 14

Topological Approach

• Borowsky Gafni STOC 93

• Herlihy Shavit STOC 93, JACM 1999

• Saks Zaharoglou STOC 93, SIAM 2000

• Showed k-set agreement impossible– Generalization of consensus [Chaudhuri 90]

– Open problem for several years

Page 15: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 15

The Topological Approach• Computations as geometric object

– Use topological methods to show existence of “bad” execution.

• Borowsky & Gafni– Sperner’s Lemma

• Herlihy & Shavit– Simplicial complexes & homology

• Saks & Zaharoglou– Brouwer fixed-point theorem

Page 16: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 16

35,000 f t

34,000 f t

33,000 f t

32,000 f t

31,000 f t

36,000 f tDL227

AA082AL991

Pick your own altitude.How many slots do we need to allow safe coordination?

Example: Autonomous Air Traffic Control

Page 17: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 17

Example Task: Renaming

• Process has input name (flight #) • Must generate output name (altitude) • Interested in comparison-based

protocols:– Equality: A=B?– Order: A<B?– Nothing else (rules out trivial solutions)

Page 18: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 18

History• Proposed by Attiya, Bar-Noy, Dolev, Peleg,

, Reischuk• They showed

– Solution for 2n+1 names– impossibility for n+2 names– Intermediate values hot open question

• Long-standing open problem …– Topological methods showed …– Intermediate values also impossible

Page 19: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 19

A Vertex

Point in high-dimensional Euclidean Space

Page 20: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 20

Simplexes

0-simplex (vertex)

1-simplex (edge)

2-simplex (solid triangle)

3-simplex (solid tetrahedron)

Page 21: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 21

Simplicial Complex

Page 22: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 22

A CycleOK to think of it as oriented

path

Also works in higher

dimensions

Page 23: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 23

A BoundaryA cycle is a

boundary if it goes around a “solid” region

Encompasses no “holes”

Page 24: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 24

Not Every Cycle is a BoundaryGoes around

a hole

Page 25: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 25

Connectivity

• A complex is n-connected if– Every cycle of dimension n or less– Is also a boundary

• No “holes” in any dimension– Fundamental group is trivial– Higher homology groups trivial

Page 26: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 26

Chromatic Complexes

Each n-simplex colored by ndistinct colors

Corresponding to process ids

Page 27: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 27

Chromatic Simplicial MapColor-preserving

vertex-to-vertex mapThat also carries

simplexes to simplexes

Page 28: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 28

Chromatic Simplicial Maps Preserve Boundaries

A simplicial map can’t wrap a boundary around a

“hole”

Page 29: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 29

Vertex = Process State

Process id (color)

Value (input or output)7

Page 30: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 30

Simplex = Global State

0 1

2

0 1

2

Page 31: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 31

Complex = Global States

Page 32: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 32

input complex(all possible flights)

output complex(all consistent choices)

AA082

AL991

2

1

1

2

Decision Task

Task specrelation

Page 33: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 33

input complex output complex

P,6

1

1

1

1

12 3

2

32

3

R

AL991

AA082

DL227

1

3 Planes, 3 Slots

input complex output complex

Page 34: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 34

3 Planes, 4 Slots

1

2 3

4

4

4

Page 35: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 35

3 Planes, 4 Slots

2 3

4

2 3

1 4 11

2 32 33

4 1

4 1 4 11 4 1

Page 36: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 36

3 Planes, 4 Slots1

1

44

4

1

3

3

3

2

22

214

Page 37: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 37

input complex output complex

R

1

14

4

41

3

3

32

22

214

3 Planes, 4 Slots

Page 38: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 38

Shared Memory

• Asynchronous– arbitrary delays– e.g., interrupts, page faults, etc.

• wait-free– Processes can fail or be slow

• Communication by reading and writing shared memory

Page 39: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 39

protocol if and only if one can free-waitA task has a its input complex so that chromatically subdivide

to its color preserving simplicial mapthere exists a output complex that refines the task spec.

task spec

Simplicial map

Asynchronous Computability Theorem

Input complex output complex

Page 40: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 40

Protocol Complex

• Each protocol defines a complex– vertex: sequence of messages received– simplex: compatible set of vertexes

• Induces subdivision of input complex

Page 41: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 41

One-Round Protocol Complex

P runs solo

0 000 00

Q runs solo

P and Q see one another

Page 42: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 42

One-Round Protocol ComplexR runs solo

P and Q run solo

(Some simplexes omitted for clarity)

Page 43: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 43

Summary

Input complex Output complex

Protocol complex

δ

R

AL991

AA082DL227

Task def

1

14

4

41

3

3

32

22

214

Page 44: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 44

P

P Q

Q

simplicial map

only :algorthmcomparison based compares plane ids

PQ

P,1Q,1

P,3

P,2 Q,3

Q,2

If view = (my_id, )decide 1else if my_id < his_id

decide 2else decide 3

2 Planes 3 Slots

Page 45: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 45

3 Planes 4 Slots

• Impossibility by reduction• Assume a protocol for 3 airplanes, 4 slots• Choose

– 0 if your name is even– 1 if your name is odd

• Result– Not all odd– Not all even

Page 46: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 46

Reminder: Cannot Map Boundary Around a Hole

Hole is an obstruction?

Page 47: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 47

Output Complex (3 processes)

1

0

1 1

0 0

Page 48: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 48

Protocol Complex (schematic)

Page 49: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 49

Boundary = 2-Process Executions

Page 50: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 50

Protocol Complex for One Process Execution

P( ) decides 1 WLOG

P( ) decides 1 by symmetry

P( ) decides 1 by symmetry

Page 51: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 51

2-Process execution might be mapped this way …

protocol

output

boundary

Wraps around-1 times

Page 52: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 52

2-Process execution might be mapped that way …

protocol

output

boundary

Wraps around+2 times

Page 53: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 53

In General …

protocol

output

Wraps around hole3k-1 ≠ 0 times

QED!

boundary

Page 54: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 54

Other Models of Computation

• Powerful atomic operations– Compare&swap, test&set, etc

• Synchronous fail-stop– Computation in rounds

Page 55: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 55

35,000 f t

34,000 f t

33,000 f t

32,000 f t

31,000 f t

DL227

AA082AL991

3 Planes Need 5 Slots

Page 56: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 56

Topological Approach to Asynchrony

A multitude of concurrent executions

Asynchrony

Topological Approach

Reasoning about geometric objects

Page 57: Topology and Distributed Computing - Brown Universitycs.brown.edu/~mph/finland.pdf · making sure that everything doesn’t happen all at once. ... •Consensus – Trivial in uniprocessor

22-Jul-04 57

The Glorious Future

• Our work– Asynchronous, wait-free, one-shot, RW

memory• Open problems

– Long-lived computations– Other kinds of memory (compare&swap)– Randomization– Other progress conditions …