Practical Parallel Nesting for Software Transactional Memory Nuno - - PowerPoint PPT Presentation

practical parallel nesting for software transactional
SMART_READER_LITE
LIVE PREVIEW

Practical Parallel Nesting for Software Transactional Memory Nuno - - PowerPoint PPT Presentation

Practical Parallel Nesting for Software Transactional Memory Nuno Diegues and Jo ao Cachopo ndiegues@gsd.inesc-id.pt 1/29 Problem A 18 16 14 12 Speedup 10 8 6 4 2 0 1 2 4 8 16 32 48 # threads 2/29 Problem A 18 B 16


slide-1
SLIDE 1

Practical Parallel Nesting for Software Transactional Memory

Nuno Diegues and Jo˜ ao Cachopo

ndiegues@gsd.inesc-id.pt

1/29

slide-2
SLIDE 2

Problem

2 4 6 8 10 12 14 16 18 1 2 4 8 16 32 48 Speedup # threads A 2/29

slide-3
SLIDE 3

Problem

2 4 6 8 10 12 14 16 18 1 2 4 8 16 32 48 Speedup # threads A B 2/29

slide-4
SLIDE 4

Problem

2 4 6 8 10 12 14 16 18 1 2 4 8 16 32 48 Speedup # threads A B

What is causing this?

2/29

slide-5
SLIDE 5

Good case

T0 T1 T2 T3 T4 C1 A

3/29

slide-6
SLIDE 6

Good case

T0 T1 T2 T3 T4 C1 A B

3/29

slide-7
SLIDE 7

Good case

T0 T1 T2 T3 T4 C1 A B C D

3/29

slide-8
SLIDE 8

Good case

T0 T1 T2 T3 T4 C4 C3 C2 C1

3/29

slide-9
SLIDE 9

Good case

T0 T1 T2 T3 T4 C4 C3 C2 C1 A B C D

3/29

slide-10
SLIDE 10

Problem

T0 T1 T2 T3 T4 C4 C3 C2 C1 A B C D

4/29

slide-11
SLIDE 11

Problem

T0 T1 T2 T3 T4 C4 C3 C2 C1

A B C D

4/29

slide-12
SLIDE 12

Problem

T0 T1 T2 T3 T4 C4 C3 C2 C1

A B C D B B D D D C

4/29

slide-13
SLIDE 13

Problem Optimistic assumption deceived

4/29

slide-14
SLIDE 14

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

A B C D B B D D D C

5/29

slide-15
SLIDE 15

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1 A B C D

5/29

slide-16
SLIDE 16

Proposed solution Explore parallelism within transactions

5/29

slide-17
SLIDE 17

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1 B C D

5/29

slide-18
SLIDE 18

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1 B C D

5/29

slide-19
SLIDE 19

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

5/29

slide-20
SLIDE 20

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

5/29

slide-21
SLIDE 21

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

5/29

slide-22
SLIDE 22

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

5/29

slide-23
SLIDE 23

Proposed solution

T0 T1 T2 T3 T4 C4 C3 C2 C1

5/29

slide-24
SLIDE 24

Goal

Exploit inner nesting to avoid conflict-prone workloads Aimed for long transactions

6/29

slide-25
SLIDE 25

Goal

Exploit inner nesting to avoid conflict-prone workloads Aimed for long transactions

1

More prone to conflicts

2

Amortize inner parallelization

3

Particularly troublesome for hardware support

Less concurrency at top level — but more at the inner level

6/29

slide-26
SLIDE 26

Goal

Exploit inner nesting to avoid conflict-prone workloads Aimed for long transactions

1

More prone to conflicts

2

Amortize inner parallelization

3

Particularly troublesome for hardware support

Less concurrency at top level — but more at the inner level Parallel Nesting support in STM algorithm

6/29

slide-27
SLIDE 27

Outline

The problem at hand Overview of Parallel Nesting in STM Challenges hindering its practicality Experimental results

7/29

slide-28
SLIDE 28

High-level overview

A

Top-level transaction, i.e., normal one

8/29

slide-29
SLIDE 29

High-level overview

A W Z global clock

Traditional (outer) concurrency

8/29

slide-30
SLIDE 30

High-level overview

A B

Nested transaction

8/29

slide-31
SLIDE 31

High-level overview

A C D B

Parallel Nested Transactions

8/29

slide-32
SLIDE 32

High-level overview

A C

nClock: 0

D

nClock: 0 nClock: 0

B

nClock: 0

Regulate inner concurrency, as well as (traditional) outer concurrency

8/29

slide-33
SLIDE 33

High-level overview

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

Unbounded depth levels, no programming model constraints

8/29

slide-34
SLIDE 34

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set

value value value value

shared memory

blank

9/29

slide-35
SLIDE 35

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read:

value value value value

shared memory

blank

9/29

slide-36
SLIDE 36

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read

Read orange item

9/29

slide-37
SLIDE 37

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read write-set

Check own writes

9/29

slide-38
SLIDE 38

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read write-set

Check writes of parent

9/29

slide-39
SLIDE 39

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read write-set

Read green item — check further in ancestors

9/29

slide-40
SLIDE 40

Challenge: read-after-write

A C B

nClock: 1

D

nClock: 0

committed

E

nClock: 0 nClock: 0

write-set write-set read write-set

Normal case

9/29

slide-41
SLIDE 41

Read-after-writes in TM standard benchmarks

test reads (∗103) raws (∗103) % bench7-r-notrav 8000 31 bench7-rw-notrav 9000 34 bench7-w-notrav 5000 19 lee-mainboard 507000 3 lee-memboard 281000 2 lee-sparselong 67000 lee-sparseshort 1000 vac-reservations 84000 0.2 vac-deletions 33000 600 1.8

10/29

slide-42
SLIDE 42

Read operation

Read operation must account for RAWs

◮ uncommon case, however 11/29

slide-43
SLIDE 43

Read operation

Read operation must account for RAWs

◮ uncommon case, however

Practical solution, by not polluting the common case

11/29

slide-44
SLIDE 44

Read operation

Read operation must account for RAWs

◮ uncommon case, however

Practical solution, by not polluting the common case Single place to buffer write to a variable

◮ regardless of depth ◮ less metadata 11/29

slide-45
SLIDE 45

Read operation

Read operation must account for RAWs

◮ uncommon case, however

Practical solution, by not polluting the common case Single place to buffer write to a variable

◮ regardless of depth ◮ less metadata ◮ assumes no concurrent writes ⋆ for performance, not correctness ⋆ slow-mode fallback path ⋆ if common, exploit other inner parallelism level 11/29

slide-46
SLIDE 46

Practical Parallel Nesting

A D E B C

12/29

slide-47
SLIDE 47

Practical Parallel Nesting

A D E B C

variable X

permanent

variable Y

permanent

12/29

slide-48
SLIDE 48

Practical Parallel Nesting

A D E B C

variable X

permanent

variable Y

permanent version: value: previous: 99 version: value: previous: 42

15 7

...

12/29

slide-49
SLIDE 49

Practical Parallel Nesting

A D E B C

variable X

permanent tentative

variable Y

permanent tentative

12/29

slide-50
SLIDE 50

Practical Parallel Nesting

A D E B C

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

E A B

12/29

slide-51
SLIDE 51

Practical Parallel Nesting

A D E B C

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

E A B write-set write-set write-set

13/29

slide-52
SLIDE 52

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

  • rec5
  • rec1
  • rec2

13/29

slide-53
SLIDE 53

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

  • rec5
  • rec1
  • rec2

committed

  • rec5

13/29

slide-54
SLIDE 54

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

  • rec5
  • rec1
  • rec2

committed

  • rec5
  • rec5

committed

  • rec4

13/29

slide-55
SLIDE 55

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

variable X

permanent

  • rec:

value: previous: 10 tentative

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 6

  • rec5
  • rec1
  • rec2

committed

  • rec5
  • rec5

committed

  • rec4
  • rec2
  • rec5

committed 13/29

slide-56
SLIDE 56

Why multi-version?

Parallel Nesting allows partial aborts

14/29

slide-57
SLIDE 57

Why multi-version?

Parallel Nesting allows partial aborts Efficient write management in nesting trees

14/29

slide-58
SLIDE 58

Why multi-version?

A C

variable Y

permanent

  • rec:

value: tentative

A write:

D E B

  • rec2
  • rec4
  • rec5

committed

  • rec5

committed

  • rec5

committed 15/29

slide-59
SLIDE 59

Why multi-version?

A C

variable Y

permanent

  • rec:

value: 42 tentative

C write: write:

D E B

  • rec2
  • rec4
  • rec5

committed

  • rec5

committed

  • rec5

committed

42

15/29

slide-60
SLIDE 60

Why multi-version?

A C

variable Y

permanent

  • rec:

value: 42 tentative

C write: write:

D E B

  • rec2
  • rec4
  • rec5

committed

  • rec5

committed

  • rec5

committed

42

  • rec2
  • rec5

aborted 15/29

slide-61
SLIDE 61

Why multi-version?

A C

variable Y

permanent

  • rec:

value: 42 tentative

C write: write:

D E B

  • rec2
  • rec4
  • rec5

committed

  • rec5

committed

  • rec5

committed

10

15/29

slide-62
SLIDE 62

More details Lock-free algorithms pseudo-code

16/29

slide-63
SLIDE 63

More details Formal guarantees

16/29

slide-64
SLIDE 64

More details Further evaluation results

16/29

slide-65
SLIDE 65

Evaluation - objectives

1 Can we use parallel nesting to improve performance of STMs? 17/29

slide-66
SLIDE 66

Evaluation - objectives

1 Can we use parallel nesting to improve performance of STMs? 2 Compare with other STMs with parallel nesting support 17/29

slide-67
SLIDE 67

Evaluation - objectives

1 Can we use parallel nesting to improve performance of STMs? 2 Compare with other STMs with parallel nesting support 3 Overhead assessment 17/29

slide-68
SLIDE 68

Evaluation - example plot

0.5 1 1.5 2 2.5 1x1 1x2 1x3 2x3 4x3 8x3 16x3 speedup # threads: top-level txs x nested txs

(6 transactions) vs (2 top-level × 3 parallel nested)

18/29

slide-69
SLIDE 69

Evaluation - benchmarks

STMBench7 - 3 workloads, varying read/write Lee-TM - 4 workloads, varying transaction size Vacation from STAMP - 2 workloads, varying contention

19/29

slide-70
SLIDE 70

Evaluation - benchmarks

STMBench7 - 3 workloads, varying read/write Lee-TM - 4 workloads, varying transaction size Vacation from STAMP - 2 workloads, varying contention Manual approach to identify target transactions

19/29

slide-71
SLIDE 71

Evaluation - STMBench7

0.5 1 1.5 2 2.5 1x1 1x2 1x3 2x3 4x3 8x3 16x3 speedup # threads: top-level txs x nested txs

balanced read-write workload; untap two-fold speedup

20/29

slide-72
SLIDE 72

Evaluation - Lee-TM - long transactions

0.5 1 1.5 2 2.5 1x1 1x2 1x3 2x3 4x3 8x3 16x3 speedup # threads: top-level txs x nested txs

similar improvements with parallel nesting

21/29

slide-73
SLIDE 73

Evaluation - Lee-TM - short transactions

0.5 1 1.5 2 2.5 1x1 1x2 1x3 2x3 4x3 8x3 16x3 speedup # threads: top-level txs x nested txs

inner-parallelism does not pay off

22/29

slide-74
SLIDE 74

Evaluation - Vacation - high contention

2 4 6 8 10 12 14 1x1 1x2 1x4 1x8 1x16 2x16 3x16 speedup # threads: top-level txs x nested txs

improvement of 170%

23/29

slide-75
SLIDE 75

Evaluation - Vacation - low contention

2 4 6 8 10 12 14 16 18 1x1 1x2 1x4 1x8 1x16 2x16 3x16 speedup # threads: top-level txs x nested txs

barely any conflicts to overcome

24/29

slide-76
SLIDE 76

Evaluation - Comparison of STMs

NeSTM [SPAA10] — eager conflict management; blocking PNSTM [PPoPP10] — conflict resolution independent of access type

25/29

slide-77
SLIDE 77

Evaluation - Vacation

10 20 30 40 50 60 70 1x1 1x2 1x4 1x8 1x16 2x16 3x16 throughput (105 ops/sec) # threads

jvstm-tl nestm-tl pnstm-tl

26/29

slide-78
SLIDE 78

Evaluation - Vacation

10 20 30 40 50 60 70 1x1 1x2 1x4 1x8 1x16 2x16 3x16 throughput (105 ops/sec) # threads

jvstm-tl jvstm-pn nestm-tl nestm-pn pnstm-tl pnstm-pn

26/29

slide-79
SLIDE 79

Overhead with nesting depth

1 2 3 4 5 6 1 8 32 128 throughput (105 ops/sec) # depth

jvstm nestm pnstm

27/29

slide-80
SLIDE 80

Overhead with nesting depth

1 2 3 4 5 6 1 8 32 128 throughput (105 ops/sec) # depth

jvstm nestm pnstm

27/29

slide-81
SLIDE 81

Summary

Optimistic expectations can be deceived

28/29

slide-82
SLIDE 82

Summary

Optimistic expectations can be deceived Reducing parallelism that is suffering data contention

◮ ...and exploit inner-parallelism ◮ Parallel Nesting is key to achieve that ◮ long running transactions 28/29

slide-83
SLIDE 83

Summary

Optimistic expectations can be deceived Reducing parallelism that is suffering data contention

◮ ...and exploit inner-parallelism ◮ Parallel Nesting is key to achieve that ◮ long running transactions

Multi-versioned STM with Practical Parallel Nesting

◮ improvements in motivation scenario ◮ ...and with respect to state of the art

Full fledged lock-free JVSTM

◮ http://inesc-id-esw.github.io/jvstm/ 28/29

slide-84
SLIDE 84

Thank you

Questions?

29/29

slide-85
SLIDE 85

JVSTM

Global latest commit: 0

30/29

slide-86
SLIDE 86

JVSTM

Global latest commit: 0

A (rw)

starting version: 0 30/29

slide-87
SLIDE 87

JVSTM

Global latest commit: 0

A (rw)

starting version: 0

w(x,6) write set: { x: 6 }

30/29

slide-88
SLIDE 88

JVSTM

Global latest commit: 1

version: value: previous: 1 6

A (rw)

starting version: 0

w(x,6) write set: { x: 6 }

variable X

permanent tentative

30/29

slide-89
SLIDE 89

JVSTM

Global latest commit: 1

version: value: previous: 1 6

B (rw)

starting version: 1

variable X

permanent tentative

30/29

slide-90
SLIDE 90

JVSTM

Global latest commit: 1

version: value: previous: 1 6

B (rw)

starting version: 1

variable X

permanent tentative

  • wner:

status:

Orec1

Alive B 30/29

slide-91
SLIDE 91

JVSTM

Global latest commit: 1

version: value: previous: 1 6

B (rw)

starting version: 1

variable X

permanent tentative

  • wner:

status:

Orec1

Alive B

  • rec:

value: previous:

  • rec1

w(x,0) write set: { x }

30/29

slide-92
SLIDE 92

JVSTM

Global latest commit: 2

version: value: previous: 2

B (rw)

starting version: 1

variable X

permanent tentative

  • wner:

status:

Orec1

2 B

  • rec:

value: previous:

  • rec1

write set: { x } w(x,0) version: value: previous: 1 6

30/29

slide-93
SLIDE 93

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • wner:

status:

Orec1

2 B

  • rec:

value: previous:

  • rec1

version: value: previous: 1 6

C (rw)

starting version: 2

r(x) = ?

  • wner:

status:

Orec2

Alive C

write set: { y, z, w, ... }

30/29

slide-94
SLIDE 94

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • wner:

status:

Orec1

2 B

  • rec:

value: previous:

  • rec1

version: value: previous: 1 6

C (rw)

starting version: 2

r(x) = 0

  • wner:

status:

Orec2

Alive C

write set: { y, z, w, ... }

30/29

slide-95
SLIDE 95

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • wner:

status:

Orec1

2 B

  • rec:

value: previous:

  • rec1

version: value: previous: 1 6

C (rw)

starting version: 2

  • wner:

status:

Orec2

Alive C

write set: { y, z, w, ... } w(x,42)

30/29

slide-96
SLIDE 96

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • wner:

status:

Orec1

2 B

  • rec:

value: previous: 42

  • rec2

version: value: previous: 1 6

C (rw)

starting version: 2

  • wner:

status:

Orec2

Alive C

write set: { x, y, z, w, ... } w(x,42)

30/29

slide-97
SLIDE 97

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • rec:

value: previous: 42

  • rec2

version: value: previous: 1 6

C (rw)

starting version: 2

  • wner:

status:

Orec2

Abort C

write set: { x, y, z, w, ... }

30/29

slide-98
SLIDE 98

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • rec:

value: previous: 42

  • rec2

version: value: previous: 1 6

C (rw)

starting version: 2

  • wner:

status:

Orec2

Abort C

write set: { x, y, z, w, ... }

D (rw)

starting version: 2

r(x) = ?

30/29

slide-99
SLIDE 99

JVSTM

Global latest commit: 2

version: value: previous: 2

variable X

permanent tentative

  • rec:

value: previous: 42

  • rec2

version: value: previous: 1 6

C (rw)

starting version: 2

  • wner:

status:

Orec2

Abort C

write set: { x, y, z, w, ... }

D (rw)

starting version: 2

r(x) = ? write set: { }

30/29

slide-100
SLIDE 100

Nesting in Read-sets

TA

31/29

slide-101
SLIDE 101

Nesting in Read-sets

TA

new read-set

31/29

slide-102
SLIDE 102

Nesting in Read-sets

TA

new read-set

r(x)

31/29

slide-103
SLIDE 103

Nesting in Read-sets

TA

new read-set

31/29

slide-104
SLIDE 104

Nesting in Read-sets

TA

new read-set

Thread 1

read-set pool

31/29

slide-105
SLIDE 105

Nesting in Read-sets

TA

new read-set

Thread 1

read-set pool

31/29

slide-106
SLIDE 106

Nesting in Read-sets

TA Thread 1

read-set pool

TB

31/29

slide-107
SLIDE 107

Nesting in Read-sets

TA Thread 1

read-set pool

TB

r(x)

31/29

slide-108
SLIDE 108

Nesting in Read-sets

TA Thread 1

read-set pool

TB

r(x)

31/29

slide-109
SLIDE 109

Nesting in Read-sets

TA Thread 1

read-set pool

TB

r(x)

31/29

slide-110
SLIDE 110

Nesting in Read-sets

TA Thread 1

read-set pool

TB

r(x)

31/29

slide-111
SLIDE 111

Nesting in Read-sets

TA Thread 1

read-set pool

TB

r(x)

Cannot be used in nesting

31/29

slide-112
SLIDE 112

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2

31/29

slide-113
SLIDE 113

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2

31/29

slide-114
SLIDE 114

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2 committed

31/29

slide-115
SLIDE 115

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2 committed

array: isFree: false counter: thread2's

Atomic Counter 1

31/29

slide-116
SLIDE 116

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2 committed Atomic Counter 1

array: isFree: false counter: thread2's array: isFree: false counter: thread2's array: isFree: false counter: thread2's array: isFree: true counter: thread2's read-set next

31/29

slide-117
SLIDE 117

Nesting in Read-sets

Thread 2

read-set pool

A B

thread1 thread2 committed Atomic Counter 2

array: isFree: false counter: thread2's array: isFree: true counter: thread2's array: isFree: false counter: thread2's array: isFree: true counter: thread2's

31/29

slide-118
SLIDE 118

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

clock: 0 clock: 0 clock: 0 clock: 0 clock: 0

32/29

slide-119
SLIDE 119

Practical Parallel Nesting

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 B: 0 ancV A: 0 clock: 0 clock: 0 clock: 0 clock: 0 clock: 0

32/29

slide-120
SLIDE 120

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 B: 0 ancV A: 0 clock: 0 clock: 0 clock: 0 clock: 0 clock: 0

32/29

slide-121
SLIDE 121

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 0 E

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4
  • rec5

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 B: 0 ancV A: 0 clock: 0 clock: 0 clock: 0 clock: 0 clock: 0

32/29

slide-122
SLIDE 122

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed 32/29

slide-123
SLIDE 123

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed 32/29

slide-124
SLIDE 124

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed 32/29

slide-125
SLIDE 125

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed 32/29

slide-126
SLIDE 126

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 0 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed

restart

32/29

slide-127
SLIDE 127

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 1 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed 32/29

slide-128
SLIDE 128

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2
  • rec4

ancV A: 0 B: 1 ancV A: 0 ancV A: 0 clock: 0 clock: 1 clock: 0 clock: 0

  • rec5

committed

rS: { Y -> IP }

32/29

slide-129
SLIDE 129

Practical Parallel Nesting

variable Y

permanent

  • rec:

value: previous: 15 tentative

  • rec:

value: previous: 5

  • rec5
  • rec1
  • wner:

status:

Orec5

Alive nestedVer: 1 B

  • wner:

status:

Orec1

Alive nestedVer: 0 A

wS: { Y } wS: { Y }

A D E B C

  • rec1
  • rec3
  • rec2

ancV A: 0 ancV A: 0 clock: 0 clock: 2 clock: 0

  • rec5

committed

rS: { Y -> IP }

  • rec5

committed 32/29

slide-130
SLIDE 130

Why multi-version?

write x=1

A

write y=42

C B

read x:1 write y=0 write x:2 read x:2 write z=2 value of "y" for A time 42

33/29