You are on page 1of 8

Implementing Lock Free Concurrency with AKKA Sameer Arora

Agenda

Actor Model for Concurrency.


Actors V Threads.

Sleeping Barber Problem.


Introduction to Akka. Demo Questions & Feedback

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 .

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 Throughput.

Sleeping Barber Problem

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.

Demo
Sleeping Barber problem with Akka
Simple Routing Application on Akka

Questions/Comments/Feedback

You might also like