Presentation is loading. Please wait.

Presentation is loading. Please wait.

Concurrent Message Processing using Transactional Memory in the Actor Model WTM 2013 Pascal Felber, Derin Harmanci, Yaroslav Hayduk and Anita Sobe

Similar presentations


Presentation on theme: "Concurrent Message Processing using Transactional Memory in the Actor Model WTM 2013 Pascal Felber, Derin Harmanci, Yaroslav Hayduk and Anita Sobe"— Presentation transcript:

1 Concurrent Message Processing using Transactional Memory in the Actor Model WTM 2013 Pascal Felber, Derin Harmanci, Yaroslav Hayduk and Anita Sobe first.last@unine.ch

2 The Actor Model Hewitt & Baker - „Laws for Communicating Parallel Processes“ Motivated by the prospect of highly parallel computing machines with many microprocessors + own local memory Yaroslav Hayduk2

3 The Actor Model – basic principles everything is an actor (VS an object) asynchronous message passing has access to its local state only strong encapsulation inherently concurrent Yaroslav Hayduk3

4 OOP and Actors: Communication Yaroslav Hayduk4 Object A Object B Actor A Object B ObjectB.publicField=10 ObjectB.publicMethod() ActorA [SendMessageTo] ActorB VS asynchronous message passing direct access

5 Essential Actor properties Processes one message at a time – Yey! No race conditions or other hazards No (access to) shared state Can send messages to other actors only Switch its behavior Yaroslav Hayduk5

6 Behind the (Actor) scenes Yaroslav Hayduk6 Mailbox … Contains 2 Insert 3 25689 Local Actor state In progress: Contains 8 C C A A B B A “List” Actor Remove 9

7 Main issues 1. The processing of one message at a time Yaroslav Hayduk7

8 Notable Related Work Scholliers et al. – Parallel Actor Monitors – does not use STM for processing messages concurrently Shams et al. – Habanero Scala – async-finish programming model – processes parts of one message (and not many messages) concurrently Yaroslav Hayduk8

9 Idea: Process multiple messages concurrently Problem: the list can be easily corrupted Solution: Wrap each message processing in an STM transaction. When conflicts happen, (roll back and) repeat the message processing Yaroslav Hayduk9

10 Concurrent message processing Yaroslav Hayduk10 Actor Mailbox … Contains 2 Insert 3 25689 Local Actor state A “List” Actor Messages In progress A “List” Actor Messages In progress Contains 6 Insert 12 … Each message is processed in a transaction

11 Coordinated Transactions Yaroslav Hayduk11 A A A List Range (1..25) Actor Global list sum A List Range (100..125) Actor ……….

12 Local Actor Sum: Zoom-in Yaroslav Hayduk12 25689 Local Actor state A List Range Actor Messages In progress A List Range Actor Messages In progress 1.Calculate local sum 2.Forward new partial sum 3.Block (for consistency) New partial sum Prev partial sum

13 Main issues 2. Extensive blocking of actors involved in a coordinated transaction Yaroslav Hayduk13

14 Idea: Remove blocking; process other messages speculatively Pre-commit the local coordinated transaction Process other messages in a transaction speculatively Yaroslav Hayduk14

15 Non-blocking coordinated transactions Yaroslav Hayduk15 25689 Local Actor state A List Range Actor Messages In progress A List Range Actor Messages In progress Saved: Partially committed local coordinated transaction Actor Mailbox … Contains 2 List sum Speculatively process: Insert 3

16 Evaluation Yaroslav Hayduk16

17 Evaluation Yaroslav Hayduk17

18 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 Yaroslav Hayduk18

19 Thank you Questions?


Download ppt "Concurrent Message Processing using Transactional Memory in the Actor Model WTM 2013 Pascal Felber, Derin Harmanci, Yaroslav Hayduk and Anita Sobe"

Similar presentations


Ads by Google