1 / 19

Concurrent Message Processing using Transactional Memory in the Actor Model

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. The Actor Model. Hewitt & Baker - „ Laws for Communicating Parallel Processes “

tamyra
Télécharger la présentation

Concurrent Message Processing using Transactional Memory in the Actor Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. The Actor Model • Hewitt & Baker - „Lawsfor CommunicatingParallelProcesses“ • Motivated by the prospect of highly parallel computing machines with many microprocessors + own local memory Yaroslav Hayduk

  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 Hayduk

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

  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 Hayduk

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

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

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

  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 Hayduk

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

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

  12. 2 5 6 8 9 Local Actor Sum: Zoom-in A List Range Actor Messages In progress Local Actor state New partial sum Prev partial sum Calculate local sum Forward new partial sum Block (for consistency) Yaroslav Hayduk

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

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

  15. 2 5 6 8 9 Non-blocking coordinated transactions A List Range Actor Messages In progress Local Actor state Speculatively process: Insert 3 Saved: Partially committed local coordinated transaction Actor Mailbox … List sum Contains 2 Yaroslav Hayduk

  16. Evaluation Yaroslav Hayduk

  17. Evaluation Yaroslav Hayduk

  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 Hayduk

  19. Thank you Questions?

More Related