Development of concurrent and distributed programs with the Actor model and Akka César Aguilera Padilla Thematic CERN School of Computing Split, 27th of.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

ARCHITECTURES FOR ARTIFICIAL INTELLIGENCE SYSTEMS
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
Concurrency: introduction1 ©Magee/Kramer 2 nd Edition Concurrency State Models and Java Programs Jeff Magee and Jeff Kramer.
Computer Systems/Operating Systems - Class 8
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Software Architecture Design Instructor: Dr. Jerry Gao.
Course Instructor: Aisha Azeem
Lecture 2 – MapReduce CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed under the Creative.
MapReduce: Simplified Data Processing on Large Clusters 컴퓨터학과 김정수.
Chapter 7: Architecture Design Omar Meqdadi SE 273 Lecture 7 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
9/14/2015B.Ramamurthy1 Operating Systems : Overview Bina Ramamurthy CSE421/521.
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
 Actor Model  Software Transactional Memory  Data Flow Programming.
B.Ramamurthy9/19/20151 Operating Systems u Bina Ramamurthy CS421.
An Example Use Case Scenario
Csi315csi315 Client/Server Models. Client/Server Environment LAN or WAN Server Data Berson, Fig 1.4, p.8 clients network.
Architectural Design lecture 10. Topics covered Architectural design decisions System organisation Control styles Reference architectures.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Architectural Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle.
Information Systems Engineering. Lecture Outline Information Systems Architecture Information System Architecture components Information Engineering Phases.
Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle.
DISTRIBUTED COMPUTING. Computing? Computing is usually defined as the activity of using and improving computer technology, computer hardware and software.
CPSC 871 John D. McGregor Module 4 Session 1 Architecture Analysis/Design.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
Using a simple Rendez-Vous mechanism in Java
CSC480 Software Engineering Lecture 10 September 25, 2002.
Framework of a Simulation Based Shop Floor Controller Using HLA Pramod Vijayakumar Systems and Industrial Engineering University of Arizona.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
CS223: Software Engineering Lecture 14: Architectural Patterns.
Concurrent Object-Oriented Programming Languages Chris Tomlinson Mark Scheevel.
Csinparallel.org Workshop 307: CSinParallel: Using Map-Reduce to Teach Parallel Programming Concepts, Hands-On Dick Brown, St. Olaf College Libby Shoop,
B. Franek, poster presented at Computing in High Energy and Nuclear Physics, Praha – Czech Republic, 21 – 27 March 2009 This framework provides: -A method.
Introduction to threads
Software Architecture
Operating Systems : Overview
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Software Architecture
Part 3 Design What does design mean in different fields?
Introduction to J2EE Architecture
Replication Middleware for Cloud Based Storage Service
Operating Systems : Overview
Operating Systems : Overview
Operating Systems Bina Ramamurthy CSE421 11/27/2018 B.Ramamurthy.
Architectural Design.
Operating Systems : Overview
Distributed computing deals with hardware
Software models - Software Architecture Design Patterns
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Design Components are Code Components
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
The only thing worse than an experiment you can’t control is an experiment you can. May 6, 2019 V. Gyurjyan CHEP2007.
Presentation transcript:

Development of concurrent and distributed programs with the Actor model and Akka César Aguilera Padilla Thematic CERN School of Computing Split, 27th of May 2016

Overview Motivation What is the Actor model? When can we use the actor model? What are its advantages and drawbacks? What is Akka? Conclusions

Motivation Writing concurrent and parallel programs is tough Programming with threads, locks, atomic transactions, etc… is error prone and lead us to write code difficult to read, test and maintain

Motivation II Outcome 1: panic to code multi-threaded programs Outcome 2: single threaded applications relying on external services (Databases, file systems…) in order to handle concurrency and/or asynchronous operations for them

Motivation III Is there an alternative to deal with threads, locks, semaphores and race conditions if we want to build concurrent/parallel applications? Actor model!

Actor model Mathematical model of concurrent computation proposed by Carl Hewitt in 1973 It faces concurrent problems from a quite different perspective

Actor model II Actors  primitives for concurrency/parallelism Actors  Entities having a message queue and associated behavior  And isolated state!! Actors  Can exchange messages between each-other Actors  When an actor receives a message it can: – Send a finite number of messages to other actors – Create a finite number of new actors – Modify its interval behavior on receiving messages Hasta la vista threads! Ciao locks!

Actor model III Messages between actors are always sent asynchronously No requirement on order of message arrival Queuing and dequeuing of messages in an actor mailbox are atomic operations, no race conditions anymore Goodbye interlocks!

¿When can we use the actor model? When… – The problem to be solved can be decomposed into a set of independent tasks – The problem to be solved can be decomposed into a series of tasks linked by a clear flow In short words... when the problem can be parallelized Remember Amdahl's law

Advantages and Drawbacks Extends the benefits of object- oriented programming by splitting control flow and business logic Allows to decompose a system into interactive, autonomous and independent components that work asynchronously Sometimes creating actors may dramatically affect the system’s responsiveness The decision of where to store and run the new actors requires to archive a series of records, so if it is not done well it can lead to performance penalties in highly distributed systems

What is Akka? Akka is an open-source framework for Java and Scala that simplifies building concurrent and distributed systems on the Java Virtual Machine Aimed to solve concurrent/parallel problems by using the actor model

Akka main features Provides simple and high-level abstractions for concurrency and parallelism Provides a high performant programming model based on events, asynchronous and non-blocking Allows to build hierarchical networks of actors, ideal for building fault-tolerant applications It allows to deploy networks of actors in different Java Virtual Machines and easily interconnect with each other It is purely designed to operate in distributed environments

Conclusions The actor model is (yet) another approach to develop concurrent and distributed applications Allows to easily model concurrent and distributed systems through high-level constructions  Actors Allows to create software systems based on independent, interactive and autonomous components that interoperate asynchronously Has several implementations, most famous is Akka but there is also an implementation for C++

References and interesting links Carl Hewitt, Peter Bishop, Richard Steiger. “A Universal Modular Actor Formalism for Artificial Intelligence”. IJCAI, Akka.io, “Untyped Actors”, Jeffrey Dean and Sanjay Ghemawat. “MapReduce: Simplified Data Processing on Large Clusters, Google, write2munish on GitHub. “Akka-Essentials examples”. Essentials/tree/master/FirstAkkaApplication/src/mainhttps://github.com/write2munish/Akka- Essentials/tree/master/FirstAkkaApplication/src/main Benjamin Erb, “Concurrent Programming for Scalable Web Architectures”, Institute of Distributed Systems, Ulm University, Diego Castorina. Concurrency and Fault Tolerance Made Easy: An Intro to Akka. and-fault-tolerance-made-easy-an-intro-to-akka. and-fault-tolerance-made-easy-an-intro-to-akka Wyatt, Derek. “Akka Concurrency”, 1st ed. Artima Press, Gupta, Munish K. “Akka essentials”, 1st ed. Packt Publishing, Daniel Westheide. “The Neophyte's Guide to Scala Part 14: The Actor Approach to Concurrency”, concurrency.html. concurrency.html