Justine Rochas Thesis supervised by Ludovic Henrio (CNRS)

Slides:



Advertisements
Similar presentations
Dataflow Analysis for Datarace-Free Programs (ESOP 11) Arnab De Joint work with Deepak DSouza and Rupesh Nasre Indian Institute of Science, Bangalore.
Advertisements

Multiple Processor Systems
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Effective Static Deadlock Detection
Christian Delbe1 Christian Delbé OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis November Automatic Fault Tolerance in ProActive.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
M. Muztaba Fuad Masters in Computer Science Department of Computer Science Adelaide University Supervised By Dr. Michael J. Oudshoorn Associate Professor.
Request Scheduling for Multiactive Objects StudentJustine Rochas SupervisorLudovic Henrio Research lab INRIA-I3S-CNRS-UNS Research teamOASIS Master Thesis.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Active Objects & Co. First Year PhD Assessment Justine Rochas PhD subject Programming Model and Middleware Support for Distributed and Concurrent Application.
Fabrice Huet Mobility of Active Objects Fabrice Huet INRIA-I3S-CNRS.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
City University London
Dynamic adaptation of parallel codes Toward self-adaptable components for the Grid Françoise André, Jérémy Buisson & Jean-Louis Pazat IRISA / INSA de Rennes.
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Fault in the Future Joint work with Gianluigi Zavattaro and Einar Broch Johnsen.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Project Proposal (Title + Abstract) Due Wednesday, September 4, 2013.
Safe composition of distributed adaptable components A distributed component model Behavioural specification and verification Ludovic Henrio and Eric Madelaine.
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Oct Multi-threaded Active Objects Ludovic Henrio, Fabrice Huet, Zsolt Istvàn June 2013 –
Service Architecture of Grid Faults Diagnosis Expert System Based on Web Service Wang Mingzan, Zhang ziye Northeastern University, Shenyang, China.
Oct Active objects: programming and composing safely large-scale distributed applications Ludovic Henrio SCALE team, CNRS – Sophia Antipolis July.
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
1 Update Strategies for First Class Futures Khan Muhammad, Ludovic Henrio INRIA, Univ. Nice Sophia Antipolis,CNRS.
From Modeling to Deployment of Active Objects - A ProActive backend for ABS Ludovic Henrio, Justine Rochas With the contribution of: Fabrice Huet, Zsolt.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
Farnaz Moradi Based on slides by Andreas Larsson 2013.
Asynchronous Components with Futures: Semantics, Specification, and Proofs in a Theorem Prover Components (Distributed) Futures Formalisations (and proofs)
A Mechanized Model for CAN Protocols Context and objectives Our mechanized model Results Conclusions and Future Works Francesco Bongiovanni and Ludovic.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Parameterized Models for Distributed Java Objects Tomás Barros & Rabéa Boulifa OASIS Project INRIA Sophia Antipolis April 2004.
1 Deadlock. 2 Concurrency Issues Past lectures:  Problem: Safely coordinate access to shared resource  Solutions:  Use semaphores, monitors, locks,
A visualisation and debugging tool for multi-active objects Ludovic Henrio, Justine Rochas LAMHA, Nov 2015.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Transparent First-class Futures and Distributed Components Introduction: components, futures, and challenges Statically Representing Futures An Example.
An Optimal Broadcast Algorithm for Content-Addressable Networks Ludovic Henrio Fabrice Huet Justine Rochas 1 18/12/ OPODIS (Nice)
Distributed Components and Futures: Models and Challenges A Distributed Component Model Distributed Reconfiguration Calculi for Components and Futures.
A Theory of Distributed Objects Toward a Foundation for Component Grid Platforms Ludovic HENRIO l A Theory of Distributed Objects l Components l Perspectives.
Agenda  Quick Review  Finish Introduction  Java Threads.
Adding Concurrency to a Programming Language Peter A. Buhr and Glen Ditchfield USENIX C++ Technical Conference, Portland, Oregon, U. S. A., August 1992.
Chapter 1 Characterization of Distributed Systems
Contents. Goal and Overview. Ingredients. The Page Model.
Planning & System installation
Why Events Are A Bad Idea (for high-concurrency servers)
Types for Programs and Proofs
Advanced Topics in Distributed and Reactive Programming
Advanced Topics in Concurrency and Reactive Programming: Asynchronous Programming Majeed Kassis.
Computational Models Database Lab Minji Jo.
Chapter 3 Internet Applications and Network Programming
Spark Presentation.
Behavioural Models for Distributed Hierarchical Components
Extending Java RMI for Dynamic Reconfiguration
Distributed Components and Futures: Models and Challenges
Advanced Topics in Distributed and Reactive Programming
湖南大学-信息科学与工程学院-计算机与科学系
DISTRIBUTED COMPUTING
Towards Next Generation Panel at SAINT 2002
Architectures of distributed systems Fundamental Models
EEC 688/788 Secure and Dependable Computing
Architectures of distributed systems Fundamental Models
EEC 688/788 Secure and Dependable Computing
Architectures of distributed systems
Architectures of distributed systems Fundamental Models
EEC 688/788 Secure and Dependable Computing
Advanced Topics in Functional and Reactive Programming
Threads CSE 2431: Introduction to Operating Systems
L. Glimcher, R. Jin, G. Agrawal Presented by: Leo Glimcher
Presentation transcript:

Justine Rochas Thesis supervised by Ludovic Henrio (CNRS) Execution Support for Multi-threaded Active Objects: Design and Implementation Justine Rochas Thesis supervised by Ludovic Henrio (CNRS) Reviewers Einar Broch Johnsen University of Oslo Lionel Seinturier Université de Lille Examiners Florian Kammüller Middlesex University London Johan Montagnat CNRS Fabrice Huet Université de Nice Sophia Antipolis

Motivation Example: airline reservation system Challenges Simultaneous accesses (concurrency) From anywhere (distribution) Other examples World wide web Massively multiplayer online games Banking systems Peer-to-peer travel data booking

How do I build that? The toolbox Programming models Programming languages Middlewares APIs Technologies

Global objectives Help the programmer in developing safe distributed and concurrent systems, easily Our approach Programming model (design) Middleware (implementation) Goals to keep in mind High level of abstraction Correct behaviour

Outline Introduction Local scheduling for multiactive objects Encoding Support Conclusion Outline Introduction Actors Active objects Multiactive objects Local scheduling for multiactive objects Encoding of cooperative active objects Support for multiactive objects Conclusion & perspectives

The actor programming model (1985)

Active objects (1996) Object-oriented programming model for concurrency Asynchronous method call (request) Placeholder for the result (future) request queue active object request SAFE… NO DATA RACES thread method call

The ProActive middleware Java library for distributed active objects Active + passive objects (activity)  Java syntax & transparent futures Wait-by-necessity activity Bar bar = newActive(Bar.class, parameters, node); Foo foo = bar.compute(); active object foo.use(); local reference passive object

Limitations of active objects Inefficient local parallelism Single-threaded data manipulation Risk of deadlocks Circular dependency on future awaiting Deployment challenges Location transparency Exception handling Fault tolerance … SAFE… TOO STRICT? a b

Related works: cooperative active objects Explicit release points in requests (await) Enable request interleaving Can avoid some deadlocks Require more skills Creol (2006) JCoBox (2010) & ABS (2010) Sets of active objects sharing one active thread ABS Balancer smsb = new Balancer("sms", 15); Fut<Int> f = smsb!sendSms(); await f?; smsb two sets of active objects

Related works: Scala (2006) / Akka (2010) Single-threaded actors Still deadlock-prone (futures) Practical aspects fully addressed Akka class Master extends Actor { def receive = { case Calculate ⇒ println("Received") context.system.shutdown() }   def calculate(nbWorkers: Int) { val system = ActorSystem("PiSystem") val master = system.actorOf(Props[Master], name="m")   val future = master ? Calculate val result = Await.result(future, 3 seconds) .asInstanceOf[String] Low-level configuration mixed with the business logic

Multiactive objects (2013) Goal Local request parallelism (thread-based) Challenge Avoid data races between requests Principle Declare compatibility of requests multiple threads SAFE –> CONTROLLED

Multiactive objects in ProActive Class annotations Parallelisable requests add – log log – log Not parallelisable add – add @DefineGroups({ @Group(name="routing", selfCompatible=false), @Group(name="monitoring", selfCompatible=true) }) @DefineRules({ @Compatible({"routing","monitoring"}) }) class Peer { @MemberOf("routing") void add(Key k, Data d) { … } @MemberOf("monitoring") void log(String m) { … } }

Implementation and formal aspects of active object languages Results of the thesis Contributions to the multiactive object framework Enhanced local parallelism Execution support at the middleware level Contribution to the active object community Encoding of cooperative active objects Implementation and formal aspects of active object languages

Outline Introduction Local scheduling for multiactive objects Encoding Support Conclusion Outline Introduction Local scheduling for multiactive objects Default scheduling Thread limit Priority Encoding of cooperative active objects Support for multiactive objects Conclusion

Default scheduling of multiactive objects Maximisation of request parallelism Execute when compatible with Executing requests Or ahead in the queue Too many threads can be created

Controlling threads of multiactive objects Limit number Global thread limit Per multiactive object Limit type Hard thread limit (all threads) Soft thread limit (active threads) Can be changed programmatically @DefineThreadConfig(threadPoolSize=2, hardLimit=false) class Peer { … } threads in wait-by-necessity

Controlling threads of request groups … @Group(name="routing", selfCompatible=false, minThreads=2, maxThreads=5), @DefineThreadConfig(threadPoolSize=8, hardLimit=true) class Peer { } Threads never used by the routing group max min The programmer never  manipulates threads directly

Contention in multiactive object queue compatible compatible thread limit = 3 ready queue Request priority! [2] a [2] Declarative Scheduling for Active Objects, SAC 2014

Priority specification mechanism … @DefinePriorities({ @PriorityHierarchy({ @PrioritySet(groupNames={"G1"}), @PrioritySet(groupNames={"G2"}), @PrioritySet(groupNames={"G4","G5"}) }) @PrioritySet(groupNames={"G3"}), @PrioritySet(groupNames={"G4"}) class Peer { } G1 high priority G3 G2 G4 G5 low priority priority graph of request groups

Insertion time of requests with priority transitive graph Insertion time (ms) Same performance as integers, but more expressive Number of requests in the queue

Related works in active object scheduling Programmatic schedulers: ABS (2010), Parallel Actor Monitor (2014) Permissive Application-level scheduling: ProActive, Creol (2006) Safer Different priority locations

Local scheduling for multiactive objects Safe Expressive Easy to reason about Efficent Linked to request groups Conclusion A balanced approach

Outline Introduction Local scheduling for multiactive objects Encoding Support Conclusion Outline Introduction Local scheduling for multiactive objects Encoding of cooperative active objects ABS ProActive backend Fomalisation Support for multiactive objects Conclusion

DISTRIBUTED EXECUTION Motivation & results Translation of ABS programs into ProActive programs General comparison of active object languages MODELLING, VERIFICATION DEPLOYMENT, DISTRIBUTED EXECUTION ABS source code ProActive backend ProActive generated code

The ABS language Active object modelling language Toolset A a = new local A(); B b = new B(obj,…); b!foo(a); Active object modelling language Concurrent Object Groups (COG) Explicit syntax (! and Fut<T>) Cooperative scheduling (await) Toolset Verification & program analysis Execution through backends (Erlang, Haskell, Java…) COG foo(A a) { Fut<V> vFut = a!bar(); await vFut?; V v = vFut.get; v.doSmt(); } a o COG x y b

Challenges of the translation ABS ProActive active object model object groups active & passive objects asynchronous calls local distributed request scheduling cooperative multi-threaded

Challenges of the translation ABS ProActive active object model object groups active & passive objects asynchronous calls local distributed request scheduling cooperative multi-threaded registry COG 1 COG = 1 active object COG

Translation of a new statement ABS ProActive Server server = new Server() Server server = new Server() (1) COG cog = newActive(COG.class, {}, node2) (2) cog.registerObject(server) (3) node1 node2 (1) Create Java Object server (2) Create ProActive active object server (copy) (3) Make Java object available to ProActive active object cog (proxy) cog registry

Challenges of the translation ABS ProActive active object model object groups active & passive objects asynchronous calls local distributed request scheduling cooperative multi-threaded COG Two-level addressing system COG

Translation of an asynchronous call ABS ProActive server!start() server.getCog().execute("start", {}, server.getID()) node1 node2 server server (copy) PASSIVE OBJECTS BECOME REACHABLE getCog start registry cog (proxy) execute cog ID execute ref

Challenges of the translation ABS ProActive active object model object groups active & passive objects asynchronous calls local distributed request scheduling cooperative multi-threaded COG COG Soft thread limit

Translation of an await statement ABS ProActive await f? PAFuture.getFutureValue(f) @DefineGroups({ @Group(name="scheduling", selfCompatible=true) }) @DefineThreadConfig(threadPoolSize=1, hardLimit=false) public class COG { @MemberOf("scheduling") public ABSType execute(…) { … } (1) Make execute requests compatible (2) Limit the COG to 1 active thread Simulates the execution transfer of ABS

Formalisation: translation correctness [4] Theorem 1 from ABS to MultiASP Theorem 2 from MultiASP to ABS DISTRIBUTED ASPECTS programming model Multiactive Objects ABS MultiASP Async. call MultiASP ProActive ≈ Sync. call formalisation implementation Async. call silent actions Return sync. Assignment [4] From Modelling to Systematic Deployment of Distributed Active Objects, Coordination 2016

On representation of futures… Control flow (ABS) vs data flow (MultiASP/ProActive) No straight simulation, future indirection must be followed in the proof f1.get; { A a = new A(); Fut<Fut<Int>> f1 = a!foo(); Fut<Int> f2 = f1.get; return 0; } { A a = new A(); Fut<Fut<Int>> f1 = a!foo(); Int i = f1.get.get; return i; } class A { Fut<Int> foo() { B b = new B(); Fut<Int> f2 = b!bar(); return f2; } class B { Int bar() { while True { } ≠ future f1 future f2 empty future f1 empty in ABS… Only the progams with half-computed futures behave differently ✓ ❌ EQUIVALENCE LOST HERE

Restrictions of the translation The value of a future cannot be a future (from ABS to MultiASP) FIFO service / Causal ordering of requests (both directions) Distribution of future updates (from MultiASP to ABS) node1 node2 Restrictions due to distributed execution v v await f? f f node3 node4 v v await f? f f

Systematic deployment of cooperative active objects Cooperative active objects –> multiactive objects Faithful translation Practical result Implemented backend Formal result Proof of correctness of the simulation Conclusion Restrictions were defined thanks to formalisation

Outline Introduction Local scheduling for multiactive objects Encoding Support Conclusion Outline Introduction Local scheduling for multiactive objects Encoding of cooperative active objects Support for multiactive objects Debugging Fault tolerance Conclusion

Development and execution support For multiactive objects Help in finding bugs Help with unstable distributed environments DEBUGGING FAULT TOLERANCE

Debugger for multiactive objects Peer 2 Peer 4 Peer 1 Peer 3

Debugging: concurrent read & writes

Debugging: deadlock s

Fault tolerance

ProActive active object Recover upon faults request request ProActive active object

Checkpoint multiactive objects… thread 1 thread 2 ProActive multiactive object thread 3 thread 4 WHICH STATE SAVED??

Checkpoint with multiactive scheduling thread limit = 1 thread limit = 3 Checkpoint as-a-request, thread limit, and priority request checkpoint request request, n+1

Support for multiactive objects Request and communication debugger Several users Adapted fault tolerance protocol Extracted from the middleware as multiactive object annotations conclusion Implementation of non-functional aspects thanks to multiactive object scheduling

Outline Introduction Local scheduling for multiactive objects Encoding Support Conclusion Outline Introduction Local scheduling for multiactive objects Encoding of cooperative active objects Support for multiactive objects Conclusion Summary Perspectives

Recap(plication): peer-to-peer d d?

Recap(plication): peer-to-peer @DefineGroups({ @Group(name="dataManagement", selfCompatible=false), @Group(name="monitoring", selfCompatible=true), … }) @DefineRules({ @Compatible({"dataManagement", "monitoring"}), @DefinePriorities({ @PriorityHierarchy({ @PrioritySet({"dataManagement"}), @PrioritySet({"monitoring"}), @DefineThreadConfig(threadPoolSize=2, hardLimit=false); public class Peer { } a Multiactive object annotations Improved local scheduling Thread limit & priority

Recap(plication): peer-to-peer Efficient & robust implementation of peer-to-peer system INIT [1] An Optimal Broadcast Algorithm for Content-Addressable Networks, OPODIS 2013

Recap(plication): translation multiactive object COG Equivalent behaviour –> preservation of guarantees Translation of cooperative scheduling Proof of correctness Efficient ProActive backend for ABS

Conclusion multiactive object framework Compatibility Multi-threading Priority Thread limit Peer-to-peer Fault tolerance ProActive backend for ABS CHARACTERISTICS APPLICATIONS

Statically check absence of concurrent accesses Perspectives The multiactive object framework Mature fault tolerance Dynamic priorities Multiactive objects analysis Deadlock detection in MultiASP programs (on-going PhD) Specification and verification of multiactive components Static analysis of annotations @DefineGroups({ @Group(name="routing", …), @Group(name="monitoring", …) }) @DefineRules({ @Compatible({"routing","monitoring"}) }) class Peer { @MemberOf("routing") void add(Key k, Data d) { … } @MemberOf("monitoring") void log(String m) { … } } Statically check absence of concurrent accesses

Publications [1] Ludovic Henrio, Fabrice Huet and Justine Rochas. “An Optimal Broadcast Algorithm for Content- Addressable Networks’’. In: Proceedings of the 17th International Conference on Principles of Distributed Systems. OPODIS 2013. [2] Ludovic Henrio and Justine Rochas. “Declarative Scheduling for Active Objects”. In: Proceedings of the 29th Annual ACM Symposium on Applied Computing. SAC 2014. [3] Ge Song, Justine Rochas, Fabrice Huet and Frédéric Magoulès. “Solutions for Processing K Nearest Neighbor Joins for Massive Data on MapReduce”. In: 23rd Euromicro International Conference on Parallel, Distributed and Network-based Processing. PDP 2015. [4] Ludovic Henrio and Justine Rochas. “From Modelling to Systematic Deployment of Distributed Active Objects”. In: 18th International Conference, COORDINATION 2016, Held as Part of the 11th International Federated Conference on Distributed Computing Techniques. DisCoTec 2016. Selected for special issue of Logical Methods in Computer Science journal. [5] Ge Song, Justine Rochas, Léa El Beze, Fabrice Huet and Frédéric Magoulès. “K Nearest Neighbour Joins for Big Data on MapReduce: a Theoretical and Experimental Analysis”. In: IEEE Transactions on Knowledge and Data Engineering. 2016. Execution Support for Multi-threaded Active Objects: Design and Implementation – Justine Rochas