2. Agenda
●
Actor Model for Concurrency.
●
Actors V Threads.
●
Sleeping Barber Problem.
●
Introduction to Akka.
●
Demo
●
Questions & Feedback
2
3. Actors
●
Are Objects that communicate only by means of Asynchronous message
passing.
●
Do not expose their state to other objects/actors.
●
Provide a Non Blocking,highly performant event-driven programming model .
3
4. Actors V Threads
●
Writing Concurrent programs using Threads is too hard to write and test.
●
Shared Memory Model causes Race Conditions, Lowered throughput, deadlocks.
●
Actors are Lightweight - consume ~600 bytes memory.
●
Do not map one-to-one with OS Threads.
●
Actors remain in a suspended state – function via Schedulers running underneath.
●
Actors Offer a Lock-free approach to concurrency – helps in Scaling and increased 4
Throughput.
6. AKKA
●
Provides a Run time for Actors Programming model.
●
Manages the Actors life-cycle
●
Has API for Java and Scala .
●
Provides Integration with Spring Integration,Apache Camel, Google Guice etc.
6