Speculative Concurrent Processing with Transactional Memory in the - - PowerPoint PPT Presentation

speculative concurrent processing with transactional
SMART_READER_LITE
LIVE PREVIEW

Speculative Concurrent Processing with Transactional Memory in the - - PowerPoint PPT Presentation

Speculative Concurrent Processing with Transactional Memory in the Actor Model OPODIS 2013 Yaroslav Hayduk, Anita Sobe, Derin Harmanci, Patrick December 17, 2013 Marlier and Pascal Felber University of Neuchatel,


slide-1
SLIDE 1

This project and the research leading to these results has received funding from the European Community's Seventh Framework Programme [FP7/2007-2013] under grant agreement n° 318693

Yaroslav Hayduk, Anita Sobe, Derin Harmanci, Patrick Marlier and Pascal Felber University of Neuchatel, Switzerland

Speculative Concurrent Processing with Transactional Memory in the Actor Model

OPODIS ¡2013 ¡ ¡ December ¡17, ¡2013 ¡

slide-2
SLIDE 2

OPODIS 2013, Yaroslav Hayduk

A bit of background: The Actor Model

  • Hewitt & Baker (IFIP Congress’77) –

„Laws for Communicating Parallel Processes“ Motivated by the prospect of highly parallel computing machines with many microprocessors + own local memory

2

slide-3
SLIDE 3

OPODIS 2013, Yaroslav Hayduk

OOP and actors: Communication

  • Everything is an actor (VS an object)
  • Asynchronous message passing
  • Has access to its local state only
  • Strong encapsulation
  • Inherently concurrent

3

slide-4
SLIDE 4

OPODIS 2013, Yaroslav Hayduk

OOP and actors: Communication

4

Object ¡A ¡

ObjectB.publicMethod() ¡ ObjectB.publicField=10 ¡

ActorB.publicField ¡= ¡10 ¡ ¡

¡ ActorA ¡[SendMessageTo] ¡ActorB ¡

VS ¡

asynchronous ¡message ¡passing ¡ direct ¡access ¡

Illegal: ¡strong ¡ encapsulaCon ¡ Object ¡B ¡ Object ¡A ¡ Object ¡A ¡

slide-5
SLIDE 5

OPODIS 2013, Yaroslav Hayduk

Problem statement

  • Sequential processing of messages limits

performance & throughput

  • Multiple actors participating in the same

coordinated transaction block, causing message processing delays

5

slide-6
SLIDE 6

OPODIS 2013, Yaroslav Hayduk

Main contributions

  • A method for processing many messages

concurrently using STM, and

  • A method for removing excessive

blocking, associated with the processing

  • f coordinated transactions

⇒ both methods preserve the semantics

  • f the Actor Model

6

slide-7
SLIDE 7

OPODIS 2013, Yaroslav Hayduk

A current solution

  • Habanero Scala - Shams et al. (Scala

Days’12) – Habanero Scala ⇒ async-finish programming model

  • Main strength: processes parts of one

message concurrently

7

slide-8
SLIDE 8

OPODIS 2013, Yaroslav Hayduk

Case 1: Concurrent message processing

8

Mailbox ¡

… ¡

Contains ¡2 ¡ Insert ¡3 ¡

2 5 6 8 9

Local ¡Actor ¡state ¡ In ¡progress: ¡ Contains ¡8 ¡ A ¡ B ¡ Actor ¡C ¡(“List” ¡Actor) ¡ Remove ¡9 ¡ Contains ¡2 ¡ BoKlenecks? ¡

slide-9
SLIDE 9

OPODIS 2013, Yaroslav Hayduk

Concurrent message processing

  • Possible issues?
  • List corruption

⇒ wrap message processing in an STM transaction.

  • Altered message ordering

⇒ messages are not guaranteed to arrive in order because they are sent asynchronously

9

slide-10
SLIDE 10

OPODIS 2013, Yaroslav Hayduk 10

Case 2: Coordinated message processing

A ¡ A ¡List ¡Range ¡(1..25) ¡ Actor ¡ Global ¡list ¡sum ¡ A ¡List ¡Range ¡(100..125) ¡ Actor ¡

¡

¡ ………. ¡

slide-11
SLIDE 11

OPODIS 2013, Yaroslav Hayduk

Global list sum – actor operations magnified

11

2 5 6 8 9

Local ¡Actor ¡state ¡ A ¡List ¡Range ¡Actor ¡ ¡ ¡ ¡ ¡ ¡

  • 1. Calculate ¡local ¡sum ¡
  • 2. Forward ¡new ¡par>al ¡sum ¡
  • 3. Block ¡(for ¡consistency) ¡

New ¡par>al ¡sum ¡

Prev ¡par>al ¡sum ¡

BoKlenecks? ¡

slide-12
SLIDE 12

OPODIS 2013, Yaroslav Hayduk

Case 2: Our solution

  • Remove blocking; process other

messages speculatively ⇒ pre-commit the local coordinated transaction ⇒ process other messages in a transaction speculatively

12

slide-13
SLIDE 13

OPODIS 2013, Yaroslav Hayduk

Our solution illustrated

13

2 5 6 8 9

Local ¡Actor ¡state ¡ A ¡List ¡Range ¡Actor ¡ ¡ ¡ ¡ ¡ ¡ Messages ¡ ¡ In ¡progress ¡ Saved: ¡Par>ally ¡commiGed ¡ local ¡coordinated ¡transac>on ¡ Actor ¡Mailbox ¡

… ¡

Contains ¡2 ¡ sum ¡ Specula+vely ¡process: ¡ Contains ¡3 ¡

slide-14
SLIDE 14

OPODIS 2013, Yaroslav Hayduk

Experimental settings

  • Software: a modified Akka 2.10

distribution & Scala 2.10

  • Hardware: 48-core AMD Opteron 6172

CPUs running at 2.1GHz

  • Application: Stateful distributed sorted

integer linked-list

14

slide-15
SLIDE 15

OPODIS 2013, Yaroslav Hayduk

Results

15

ExecuCon ¡Cme ¡for ¡sequenCal, ¡concurrent, ¡and ¡ non-­‑blocking: ¡write-­‑dominated ¡workload ¡

slide-16
SLIDE 16

OPODIS 2013, Yaroslav Hayduk

Results

16

ExecuCon ¡Cme ¡for ¡sequenCal, ¡concurrent, ¡and ¡ non-­‑blocking: ¡read-­‑dominated ¡workload ¡

slide-17
SLIDE 17

OPODIS 2013, Yaroslav Hayduk

Results

17

Combined ¡concurrent ¡& ¡non-­‑blocking ¡execuCon ¡

slide-18
SLIDE 18

OPODIS 2013, Yaroslav Hayduk

Results

18

Comparing ¡with ¡Habanero ¡Scala ¡

Habanero ¡Scala ¡

slide-19
SLIDE 19

OPODIS 2013, Yaroslav Hayduk

Summary

  • By using speculation, we can achieve a

higher message throughput in the Actor Model

  • By using STM we guarantee that the

Actor’s state is never corrupted

19

slide-20
SLIDE 20

OPODIS 2013, Yaroslav Hayduk

Questions?

20