Commutativity and Coarse-Grained Exchanges.


73 views
Uploaded on:
Description
CCDP February 2011. 2. Moore\'s Law. (cap tip: Herb Sutter). Clock velocity straightening strongly. Transistor tally as yet rising. CCDP February 2011. 3. 3. . The Multicore Processor. store. Transport. Transport. shared memory. . store. reserve. More processors,Same clock. . . Sun T2000Niagara. CCDP February 2011. 4. .
Transcripts
Slide 1

Commutativity and Coarse-Grained Transactions Maurice Herlihy Brown University Joint work with Eric Koskinen and Matthew Parkinson   (POPL 10)

Slide 2

Moore\'s Law Transistor tally as yet rising Clock speed smoothing pointedly (cap tip: Herb Sutter) CCDP February 2011

Slide 3

The Multicore Processor More processors, Same clock Sun T2000 Niagara store reserve Bus shared memory CCDP February 2011 3

Slide 4

If more centers does not convey more esteem … Then why update? What Keeps Microsoft and Intel wakeful at Night? ? CCDP February 2011

Slide 5

Computers could get to resemble clothes washers You don\'t exchange it in at regular intervals for a cooler model You keep it until it breaks . Clothes washer Science? CCDP February 2011

Slide 6

What could turn out badly? Simultaneous writing computer programs is hard Locks, screens, and so forth don\'t scale Confusing Subject to halt Relies on traditions Not composable … CCDP February 2011

Slide 7

The Transactional Manifesto Threads + locking don\'t scale Replace locking with a value-based API Promising … yet not there yet CCDP February 2011

Slide 8

Challenge Do exchanges give enough simultaneousness? As actualized, apparently No . Does the value-based model give enough simultaneousness? Seemingly, Yes . CCDP February 2011

Slide 9

Skew Heaps Tree with "stack" property 0 1 2 3 4 TMW April 2010

Slide 10

Concurrent Skew Heap Insert me! Embed me! 6 0 2 1 3 4 5 TMW April 2010

Slide 11

Concurrent Skew Heap 2 6 0 Lock guardian Swap R & L 1 3 4 5 TMW April 2010

Slide 12

Concurrent Skew Heap 2 6 0 Unlock guardian 1 3 4 5 Lock right tyke TMW April 2010

Slide 13

Concurrent Skew Heap No worldwide rebalancing 6 0 1 3 Good amortized execution 4 5 2 Good simultaneousness TMW April 2010

Slide 14

Transactional Skew Heap Insert me! Embed me! 6 0 2 1 3 4 5 TMW April 2010

Slide 15

Transactional Skew Heap Good simultaneousness with locking 2 6 0 Write-compose strife! I composed Not with exchanges … 1 3 0 4 5 Confusion between string level & exchange level synchronization TMW April 2010

Slide 16

Coarse-Grained Synchronization Synchronize on abnormal state operations, Like include(), evacuate(), and so on … Not low-level peruses and composes Pessimistic : redesign set up, fix on prematurely end Optimistic : upgrade private duplicate, apply changes on submit But what is the significance of contention? TMW April 2010

Slide 17

Pessimistic Boosting Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 18

Pessimistic Boosting add(x) Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 19

Pessimistic Boosting add(x) Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 20

Pessimistic Boosting add(x) Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 21

Pessimistic Boosting add(x) rem(x) x Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 22

Pessimistic Boosting add(x) rem(x) add(y) x y Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 23

Pessimistic Boosting add(x) rem(x) member(x) x Undo Logs exchanges Abstract locks Black-box linearizable information object TMW April 2010

Slide 24

Pessimistic Boosting Thread-safe base item Log Inverses Updated set up Conflicting operations hindered by dynamic locks What does it mean for operations to struggle? TMW April 2010

Slide 25

Optimistic Boosting Black-box linearizable information object TMW April 2010

Slide 26

Optimistic Boosting private duplicates Black-box linearizable information object TMW April 2010

Slide 27

Optimistic Boosting re-try logs private duplicates Black-box linearizable information object TMW April 2010

Slide 28

Optimistic Boosting add(x) re-try logs private duplicates Black-box linearizable information object TMW April 2010

Slide 29

Optimistic Boosting add(x) re-try logs add(x) private duplicates x Black-box linearizable information object TMW April 2010

Slide 30

Optimistic Boosting add(y) add(x) re-try logs add(x) add(y) private duplicates x y Black-box linearizable information object TMW April 2010

Slide 31

On Commit re-try logs add(x) add(y) add(x) private duplicates x y add(x) Black-box linearizable information object TMW April 2010

Slide 32

No contention, apply redesigns to my duplicate On Commit re-try logs add(x) add(y) add(x) private duplicates x y add(x) x Black-box linearizable information object TMW April 2010

Slide 33

On Commit Different physical qualities, Same sensible qualities add(x) add(y) add(x) x y add(x) x TMW April 2010

Slide 34

Conflict! Prematurely end & reestablish my duplicate On Commit re-try logs add(x) rem(x) add(x) private duplicates x add(x) x Black-box linearizable information object TMW April 2010

Slide 35

Optimistic Boosting Thread-nearby question duplicates Deferred operatons kept in re-try log No inverses On confer, communicate conceded operations To different exchanges, open duplicate Transactions snoop on communicate, Abort if strife recognized What does it mean for operations to struggle? TMW April 2010

Slide 36

time Left-Movers lawful history TMW April 2010

Slide 37

time Left-Movers If and are adjoining, Ok to move prior TMW April 2010

Slide 38

time Left-Mover Example: Semaphore dec() inc() dec() 1 0 1 0

Slide 39

time Inc() is Left-mover WRT Dec() inc() dec() dec() 1 0 1 0 2 1 0

Slide 40

time Left-Mover Example: Semaphore Same grouping of calls (results unaffected) inc() dec() dec() 1 0 1 0 2 1 0

Slide 41

time Left-Mover Example: Semaphore inc() dec() dec() 3 2 3 2 4 3 2 Same last state

Slide 42

dec() inc() dec() time 0 1 0 Left-Mover Counter-case 1

Slide 43

dec() inc() dec() time 0 1 0 Dec() not Left-Mover WRT Inc() - 1

Slide 44

time Right-Movers legitimate history

Slide 45

time Right-Movers If and are nearby, Ok to move later

Slide 46

time Commutativity If and are neighboring, Ok to swap

Slide 47

time Pessimistic Semantics (change shared state set up) Txn An ask cmt Txn B ask Pessimistic Commit: Move Left of pending

Slide 48

time Pessimistic Semantics (alter shared state set up) Txn An ask abt Txn B ask

Slide 49

time Pessimistic Semantics (adjust shared state set up) Txn An ask 2 3 1 3 2 4 1 Txn B ask Pessimistic Abort: Move Right of pending Pessimistic Abort: Pending operations move Left

Slide 50

time Optimistic Semantics (change nearby duplicates; blend) Txn An ask cmt Txn B cmt Optimistic Commit: Move Right of conferred

Slide 51

time Optimistic Semantics (adjust neighborhood duplicates; combine) Txn An ask abt Txn B cmt Optimistic Abort: Discard Operations

Slide 52

Two Execution Models Algebraic Abstract Properties

Slide 53

But … Are commutativity+inverses the point of confinement? Other mathematical properties? Dynamic locks are blocking may bring about numerous exchanges may obstruct on same lock

Slide 54

Example nuclear { with (abstractLock(3)){ if (skiplist.insert(3)) { self.onAbort.add( ( λ () skiplist.remove(3))) } bigComputation(); } Lock key 3

Slide 55

Example nuclear { with (abstractLock(3)){ if ( skiplist.insert(3) ) { self.onAbort.add( ( λ () skiplist.remove(3))) } bigComputation(); } Add esteem 3

Slide 56

Example nuclear { with (abstractLock(3)){ if ( skiplist.insert(3) ) { self.onAbort.add( ( λ () skiplist.remove(3))) } bigComputation(); } If set altered, Log backwards

Slide 57

Example nuclear { with (abstractLock(3)){ if (skiplist.insert(3)) { self.onAbort.add( ( λ () skiplist.remove(3))) } bigComputation(); } Do something long, Not including skiplist

Slide 58

Conflicting Operations remove(3) insert(3) no contention

Slide 59

(3) Conflicting Locks remove(3) insert(3) No simultaneousness (3)

Slide 60

remove(3) insert(3) (3) (3) Conflicting Locks

Slide 61

remove(3) (3) (3) Conflicting Locks insert(3)

Slide 62

remove(3) (3) (3) Conflicting Locks insert(3) Lock handoff

Slide 63

Lock Handoff reliance

Slide 64

Lock Handoff reliance Lock handoff

Slide 65

Key Ideas Handing off Abstract lock Allows simultaneous non-driving supported exchanges! Clever thoughts Mechanism for passing conceptual lock Thread-neighborhood cyclic reliance check Lazy recuperation

Slide 66

Deadlock?

Slide 67

Detection Dreadlocks [Herlihy & Koskinen , SPAA 2008] Fast, incremental stop identification Low overhead Cache-accommodating

Slide 68

Waits-For Graph holding up possessed

Slide 69

Digest

Slide 70

Digest

Slide 71

Digest Uh-goodness!

Slide 72

Details Can speak to process as Bit guide (little populace) Bloom channel (bigger populace) [Herlihy & Koskinen, SPAA 2008]

Slide 73

Challenges Automation? Hypothesis demonstrating Model checking Compiler & Language support? Execution …

Recommended
View more...