12
Introduction to Actor Model of Concurrent and Distributed Computation Dmitry Tolpeko, EPAM Systems - January 2015

Introduction to actor model of concurrent and distributed

Embed Size (px)

Citation preview

Page 1: Introduction to actor model of concurrent and distributed

Introduction to Actor Model of Concurrent and Distributed Computation

Dmitry Tolpeko, EPAM Systems - January 2015

Page 2: Introduction to actor model of concurrent and distributed

What is Actor Model?

Design pattern to develop scalable concurrent and distributed applications

Page 3: Introduction to actor model of concurrent and distributed

Concurrent Models

• Shared Resources

• Actor-based Concurrency

Page 4: Introduction to actor model of concurrent and distributed

Shared Resources

• Shared Memory

• Locks

Page 5: Introduction to actor model of concurrent and distributed

Shared Resources - Advantages

• Traditional and well known

• OS and programming language support

• Relatively easy to program (no queues, no messaging i.e.)

Page 6: Introduction to actor model of concurrent and distributed

Shared Resources - Disadvantages

• Error prone and buggy

• Race conditions and deadlocks

• Over-synchronization that can impact performance

• No distributed processing

Page 7: Introduction to actor model of concurrent and distributed

Actor Model

• Similar to Object-oriented model but asynchronous, concurrent and distributed

• Actors are processes (threads) that process and send messages

• Shared nothing architecture

Page 8: Introduction to actor model of concurrent and distributed

Asynchronous

• When an Actor sends a message it is not blocked until the message processed

• Actor is not interrupted when it receives a message

• Every Actor has Mailbox, a task queue to buffer incoming messages

Page 9: Introduction to actor model of concurrent and distributed

Concurrent and Distributed

• Each Actor runs an infinite loop to read, process and send messages

• Use of messaging allows distributed processing (Multiple Actors running on multiple nodes)

Page 10: Introduction to actor model of concurrent and distributed

Topology and Life Cycle

• Actors can create other actors, the topology is dynamic

• Actor usually terminates by receiving the application specific “Stop” message

• Actor can also terminate by timeout (no messages in queue) or after completing a message

Page 11: Introduction to actor model of concurrent and distributed

Advantages of Actor Model

• Scalable

• Clear and reliable design

Page 12: Introduction to actor model of concurrent and distributed

Thank [email protected]

https://twitter.com/dmtolpeko

www.dmtolpeko.com

Join Belarus Hadoop User Group at LinkedIn