Multi-view data types Scalable concurrency in the multi-core era - - PowerPoint PPT Presentation

multi view data types
SMART_READER_LITE
LIVE PREVIEW

Multi-view data types Scalable concurrency in the multi-core era - - PowerPoint PPT Presentation

Multi-view data types Scalable concurrency in the multi-core era Deepthi Akkoorath 1 , Jos ao 2 , Annette Bieniusa 1 , Carlos Baquero 3 e Brand 1 Technical University of Kaiserslautern Germany 2 Universidade do Minho Braga, Portugal 3


slide-1
SLIDE 1

Multi-view data types

Scalable concurrency in the multi-core era

Deepthi Akkoorath1, Jos´ e Brand˜ ao2, Annette Bieniusa1, Carlos Baquero3

1Technical University of Kaiserslautern

Germany

2Universidade do Minho

Braga, Portugal

3HASLab, Universidade do Minho & INESC TEC

Braga, Portugal

slide-2
SLIDE 2

Concurrent programs in multi-core

Synchronization Speedup Threads

2/13

slide-3
SLIDE 3

Overview

Distributed systems

  • Eventual consistency + CRDTs Synchronisation free
  • Fast, Scalable, Available

Goal

  • Weak consistency Less synchronisation
  • Speed up!

3/13

slide-4
SLIDE 4

Overview

Distributed systems

  • Eventual consistency + CRDTs Synchronisation free
  • Fast, Scalable, Available

Goal

  • Weak consistency Less synchronisation
  • Speed up!

Global-Local view model Multi-view data types

3/13

slide-5
SLIDE 5

Global-local view model

Thread A Thread B 10 10 10

Local view Global view

4/13

slide-6
SLIDE 6

Global-local view model

Thread A Thread B 11 10 10

Local view Global view

c.inc()

4/13

slide-7
SLIDE 7

Global-local view model

Thread A Thread B 11 11 10

Local view Global view

c.inc() c.inc()

4/13

slide-8
SLIDE 8

Global-local view model

Thread A Thread B 11 12 10

Local view Global view

c.inc() c.inc() c.inc()

4/13

slide-9
SLIDE 9

Global-local view model

Thread A Thread B 11 12 12

Local view Global view

c.inc() c.inc() c.inc() c.merge()

4/13

slide-10
SLIDE 10

Global-local view model

Thread A Thread B 13 12 13

Local view Global view

c.inc() c.inc() c.inc() c.merge() c.merge()

4/13

slide-11
SLIDE 11

Operations

Local View: (snapshot, local)

Global view that was last seen by this thread Accumulates local updates

Global View: g

5/13

slide-12
SLIDE 12

Operations

Local View: (snapshot, local)

Global view that was last seen by this thread Accumulates local updates

Global View: g weakUpdate weakRead

5/13

slide-13
SLIDE 13

Operations

Local View: (snapshot, local)

Global view that was last seen by this thread Accumulates local updates

Global View: g weakUpdate weakRead strongUpdate strongRead

5/13

slide-14
SLIDE 14

Operations

Local View: (snapshot, local)

Global view that was last seen by this thread Accumulates local updates

Global View: g weakUpdate weakRead strongUpdate strongRead merge

5/13

slide-15
SLIDE 15

Multi-view data types

Mergeable types

  • Implements weak operations and merge

Hybrid types

  • Implements weak, strong and merge operations
  • Hybrid counter

synchronous increment when close to a target

  • Hybrid queue

weak enqueue and synchronous dequeue

6/13

slide-16
SLIDE 16

CRDTs?

7/13

slide-17
SLIDE 17

CRDTs?

  • G-Set
  • merge = union of sets
  • Counter
  • Map: id → int
  • merge = max of each elem

7/13

slide-18
SLIDE 18

CRDTs?

  • G-Set
  • merge = union of sets
  • Counter
  • Map: id → int
  • merge = max of each elem

CRDT merge is expensive

7/13

slide-19
SLIDE 19

CRDTs?

  • G-Set
  • merge = union of sets
  • Counter
  • Map: id → int
  • merge = max of each elem

CRDT merge is expensive

Multi-view data types

  • Multiple versions (view)
  • Isolated access to each view
  • Fast merge

7/13

slide-20
SLIDE 20

Counter

  • Global view: int g
  • Local view :

(int s, int l) Thread-local copies Exclusive access ⇒ no synchronization Synchronous merge

weakInc ( ) { l ++; } weakValue ( ) { return s+ l ; } merge ( ) { atomic {g += l ; s = g ; l = 0;} } strongInc ( ) { atomic {g++;} }

8/13

slide-21
SLIDE 21

Multi-view list

head T1 T2

After T1 commits:

T1 T2 head

After T2 commits:

T1 T2 head 9/13

slide-22
SLIDE 22

Evaluation: Hybrid Counter

Goal: increment until a target Periodic merge ⇒ Divergence from target Switches to strong update after a threshold

  • 10/13
slide-23
SLIDE 23

Evaluation: Breadth first traversal

Using hybrid queue : weak enqueue and strong dequeue

0.5 1 1.5 2 2.5 3 3.5 4 4.5 1 2 4 8 12 16 20 24 Speed up No.of threads Lin-Lockbased Lin-LockFree M-Lockbased M-LockFree

11/13

slide-24
SLIDE 24

Related work

Mergeable types

Doppel [Narula et al., 2014] in-memory transactions Concurrent revisions

[Burckhardt et al., 2010]

fork join model “mergeable” types

Weak consistency

Quasi linearizability [Afek et al., 2010] Weak/medium future linearizability

[Kogan and Herlihy, 2014]

K-linearizability [Aiyer et al., 2005] Quiescent consistency [Aspnes et al., 1994]

12/13

slide-25
SLIDE 25

Summary

Global-local view model

  • fast local state, distant global state

Impact on underlying data structure design

  • Multiple versions, Merge

Combination of weak and strong updates

  • A spectrum of consistency

Thank you!

akkoorath@cs.uni-kl.de

13/13

slide-26
SLIDE 26

References I

Afek, Y., Korland, G., and Yanovsky, E. (2010). Quasi-linearizability: Relaxed consistency for improved concurrency. In Proceedings of the 14th International Conference on Principles of Distributed Systems, OPODIS’10, pages 395–410, Berlin, Heidelberg. Springer-Verlag. Aiyer, A., Alvisi, L., and Bazzi, R. A. (2005). On the availability of non-strict quorum systems. In Proceedings of the 19th International Conference on Distributed Computing, DISC’05, pages 48–62, Berlin, Heidelberg. Springer-Verlag. Aspnes, J., Herlihy, M., and Shavit, N. (1994). Counting networks.

  • J. ACM, 41(5):1020–1048.

Burckhardt, S., Baldassin, A., and Leijen, D. (2010). Concurrent programming with revisions and isolation types. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA ’10, pages 691–707, New York, NY,

  • USA. ACM.

1/2

slide-27
SLIDE 27

References II

Kogan, A. and Herlihy, M. (2014). The future(s) of shared data structures. In Proceedings of the 2014 ACM Symposium on Principles of Distributed Computing, PODC ’14, pages 30–39, New York, NY, USA. ACM. Narula, N., Cutler, C., Kohler, E., and Morris, R. (2014). Phase reconciliation for contended in-memory transactions. In Proceedings of the 11th USENIX Conference on Operating Systems Design and Implementation, OSDI’14, pages 511–524, Berkeley, CA, USA. USENIX Association.

2/2