Indic threads pune12-akka-actors
-
Upload
indicthreads -
Category
Technology
-
view
451 -
download
1
description
Transcript of Indic threads pune12-akka-actors
![Page 1: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/1.jpg)
Implementing Lock Free Concurrency with AKKA
Sameer Arora
![Page 2: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/2.jpg)
2
Agenda● Actor Model for Concurrency.
● Actors V Threads.
● Sleeping Barber Problem.
● Introduction to Akka.
● Demo
● Questions & Feedback
![Page 3: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/3.jpg)
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 .
![Page 4: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/4.jpg)
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 Throughput.
![Page 5: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/5.jpg)
5
Sleeping Barber Problem
![Page 6: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/6.jpg)
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.
![Page 7: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/7.jpg)
7
Demo
Sleeping Barber problem with Akka
Simple Routing Application on Akka
![Page 8: Indic threads pune12-akka-actors](https://reader036.fdocuments.in/reader036/viewer/2022082920/554dc76ab4c905bd488b51e0/html5/thumbnails/8.jpg)
8
Questions/Comments/Feedback