2 nd Microsoft Rotor Workshop, Pisa, April 23-25, 2003 1 SCOOPLI for.NET: a library for concurrent object-oriented programming Volkan Arslan, Piotr Nienaltowski.

Slides:



Advertisements
Similar presentations
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 5.
Advertisements

Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
SCOOP: Simple Concurrent Object-Oriented Programming Extend the pure, strongly typed, object-oriented language Eiffel with a general and powerful concurrency.
Eiffel: Analysis, Design and Programming Bertrand Meyer (Nadia Polikarpova) Chair of Software Engineering.
Threads, SMP, and Microkernels
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 10: Advanced Object-Oriented Mechanisms (based on.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 1: Eiffel Introduction.
SCOOP on.NET Volkan Arslan Chair of Software Engineering ETH Zurich, Switzerland
Chapter 6: Process Synchronization
Department of Computer Science and Engineering University of Washington Brian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 7: References and Assignment.
CS 5704 Fall 00 1 Monitors in Java Model and Examples.
Kevin Doyle With Jenna Lau, Jonathan Ostroff and Faraz Ahmadi Torshizi. Department of Computer Science and Engineering, York University, 4700 Keele Street,
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 7: SCOOP Type System (based on work with Piotr Nienaltowski)
Chair of Software Engineering PPoPP 2003, , San Diego SCOOP it up! Piotr Nienaltowski Chair of Software Engineering, ETH Zurich, Switzerland.
Chair of Software Engineering Constants, once routines, and helper functions these slides contain advanced material and are optional.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering OOSC Lecture 20 - Concurrency Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering Piotr Nienaltowski, SCOOP Simple Concurrent Object-Oriented Programming.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 2: Dealing with Objects I.
Chair of Software Engineering SCOOP: an introduction Bertrand Meyer Chair of Software Engineering, ETH Zurich, Switzerland
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering Piotr Nienaltowski, , Concurrent Object-Oriented Programming Bertrand Meyer, Piotr Nienaltowski.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
1 Advanced Material The following slides contain advanced material and are optional.
Chair of Software Engineering SCOOP for ROTOR Bertrand Meyer Capstone (ROTOR final workshop), 2005 © Bertrand Meyer, 2005.
Chair of Software Engineering ATOT - Lecture 26, 30 June Advanced Topics in Object Technology Bertrand Meyer.
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
SCOOP: Simple Concurrent Object-Oriented Programming Piotr Nienaltowski, Volkan Arslan, Bertrand Meyer presented by: Mark Schall.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Chair of Software Engineering ATOT - Lecture 25, 30 June Advanced Topics in Object Technology Bertrand Meyer.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 9: Contracts and Inheritance (based on work with.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 6:Computational Model (based on work with Piotr Nienaltowski)
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 2: an overview of SCOOP.
PRASHANTHI NARAYAN NETTEM.
Chair of Software EngineeringPiotr Nienaltowski, 2 nd SCOOP workshop, SCOOP update and proposed extensions Piotr Nienaltowski.
 2007 Pearson Education, Inc. All rights reserved C++ as a Better C; Introducing Object Technology.
Chair of Software EngineeringOOSC – Summer Semester 2005 Object-Oriented Software Construction Bertrand Meyer Lecture 19: SCOOP Simple Concurrent Object-Oriented.
Client Server Model and Software Design TCP/IP allows a programmer to establish communication between two application and to pass data back and forth.
Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Event Library: an object-oriented library for event-driven design Volkan Arslan,
1 Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska and Henry M. Levy Presented by: Karthika Kothapally.
What is Concurrent Programming? Maram Bani Younes.
Computer System Architectures Computer System Software
Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
111 © 2002, Cisco Systems, Inc. All rights reserved.
ABSTRACT The real world is concurrent. Several things may happen at the same time. Computer systems must increasingly contend with concurrent applications.
Contracts for Concurrency - Contracts & Inheritance Aryabrata Basu University of Georgia.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Lecture 8 Page 1 CS 111 Online Other Important Synchronization Primitives Semaphores Mutexes Monitors.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Adding Concurrency to a Programming Language Peter A. Buhr and Glen Ditchfield USENIX C++ Technical Conference, Portland, Oregon, U. S. A., August 1992.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
SCOOPLI for .NET: a library for concurrent object-oriented programming
Distributed Shared Memory
Simple Concurrent Object-Oriented Programming
Outline Other synchronization primitives
Arab Open University 2nd Semester, M301 Unit 5
C# and the .NET Framework
Other Important Synchronization Primitives
Computer Engg, IIT(BHU)
Viney Sindhu Dr. Yanqing Zhang
What is Concurrent Programming?
What is Concurrent Programming?
Multithreading Tutorial
Presentation transcript:

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, SCOOPLI for.NET: a library for concurrent object-oriented programming Volkan Arslan, Piotr Nienaltowski Chair of Software Engineering, ETH Zurich

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Overview  Motivation  The SCOOP model for concurrent OO programming  SCOOPLI library  Implementation for.NET  Conclusions

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Motivation Extend a pure, strongly typed, object-oriented language with a simple, general and powerful concurrency and distribution model

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, The SCOOP model  Simple Concurrent Object-Oriented Programming  High-level concurrency mechanism  Full use of inheritance and other object-oriented techniques (genericity, agents, …)  Applicable to many physical setups: multiprocessing, multithreading, distributed execution, etc.  Minimal extension of Eiffel  one new keyword separate  Based on Design by Contract™  new semantics for preconditions

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Two-level implementation of SCOOP  SCOOP can be implemented in several environments  Microsoft.NET is our reference platform SCOOP platform-independent.NET Compact Framework POSIX…

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Asynchronous calls  Fundamental scheme of the O-O computation: feature call x.f (a)  Caller and callee handled by different processors  Asynchronous semantics

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Processors  Processor is an autonomous thread of control capable of supporting the sequential execution of instructions on one or more objects  Principal new concept introduced by SCOOP  Not to be confused with a physical CPU! It can be implemented as:  piece of hardware (computer, CPU),  process,  thread,  AppDomain,  etc.

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Access control policy  Target of a separate call must be a formal argument of the enclosing routine store (buffer: separate BUFFER; value: INTEGER) is -- Store value in buffer. do buffer.put (value) end... buf: separate BUFFER create buf.make store (buf, 10) -- instead of buf.put (10)  In order to obtain exclusive access to a separate object, use the attached entity as an argument of the corresponding call, as in store (buf, 10).

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, From preconditions to wait-conditions  Contracts in Eiffel store (buffer: BUFFER; value: INTEGER) is -- Store value in buffer. require buffer_not_full: not buffer.is_full do buffer.put (value) ensure buffer_not_empty: not buffer.is_empty end... store (buf, 10)  If buffer is separate, correctness condition buffer_not_full becomes wait condition

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Synchronization  No special mechanism is required for a client to resynchronize with its supplier after a separate call.  The client will wait if and only if it needs: x.f x.g (a) y.f... value := x.some_query  This mechanism is called wait by necessity.

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, SCOOPLI library  The library relies on two concepts:  separate client  separate supplier  Separate client is handled by a different processor than each of its separate suppliers.  SCOOPLI uses multiple inheritance to provide separateness: SEPARATE_ SUPPLIER X SEPARATE_X

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Use of SCOOPLI (1/2) SCOOPSCOOPLI x: separate X x: X -- class X is separate x: SEPARATE_X -- SEPARATE_X inherits from X and -- SEPARATE_SUPPLIER r (x, y) -- x and y are separate r (x: separate X; y: separate Y) is require not x.is_empty y.count > 5 i > 0 -- i non-separate do... end separate_execute ([x, y], agent r (x, y), agent r_precondition) r_precondition: BOOLEAN is do Result := not x.is_empty and y.count > 5 end -- separate_execute defined in -- class SEPARATE_CLIENT -- client class inherits from -- class SEPARATE_CLIENT

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Feature separate_execute of SEPARATE_CLIENT separate_execute (requested_objects: TUPLE [SEPARATE_SUPPLIER]; action: PROCEDURE [ANY, TUPLE]; wait_condition: FUNCTION [ANY, TUPLE, BOOLEAN]) Formal arguments:  requested_objects Denotes the (tuple of) objects on which exclusive locks should be acquired before calling action.  action Denotes the routine to be called on the separate client object; action corresponds to the routine that “wraps” separate calls  wait_condition Denotes the boolean function representing the wait condition for the call

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Use of SCOOPLI (1/2) SCOOPSCOOPLI x: separate X x: X -- class X is separate x: SEPARATE_X -- SEPARATE_X inherits from X and -- SEPARATE_SUPPLIER r (x, y) -- x and y are separate r (x: separate X; y: separate Y) is require not x.is_empty y.count > 5 i > 0 -- i non-separate do... end separate_execute ([x, y], agent r (x, y), agent r_precondition) r_precondition: BOOLEAN is do Result := not x.is_empty and y.count > 5 end -- separate_execute defined in -- class SEPARATE_CLIENT -- client class inherits from -- class SEPARATE_CLIENT

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Use of SCOOPLI (2/2) SCOOPSCOOPLI x.f (a) -- a is expandedseparate_routine (x, agent x.f (a)) res := x.g (a) -- g is function and returns -- reference value -- res is non-separate res ?= separate_value (x, agent x.g (a)) i := x.h (a) -- h is function and returns -- expanded value -- res is non-separate i := separate_integer_value (x, agent x.h (a)) -- use function corresponding to returned type: -- boolean_value, integer_value, real_value, -- double_value, char_value if x.count > 0 then...if separate_integer_value (x, agent x.g (a)) > 0 then...

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Feature separate_routine of SEPARATE_CLIENT separate_routine (supplier: SEPARATE_SUPPLIER; procedure: PROCEDURE [ANY, TUPLE]) Formal arguments:  supplier Denotes the separate supplier object on which the separate call to procedure is made  procedure Denotes the routine to be called on the separate supplier object

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Use of SCOOPLI (2/2) SCOOPSCOOPLI x.f (a) -- a is expandedseparate_routine (x, agent x.f (a)) res := x.g (a) -- g is function and returns -- reference value -- res is non-separate res ?= separate_value (x, agent x.g (a)) i := x.h (a) -- h is function and returns -- expanded value -- res is non-separate i := separate_integer_value (x, agent x.h (a)) -- use function corresponding to returned type: -- boolean_value, integer_value, real_value, -- double_value, char_value if x.count > 0 then...if separate_integer_value (x, agent x.g (a)) > 0 then...

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Feature separate_value of SEPARATE_CLIENT separate_value (supplier: SEPARATE_SUPPLIER; function: FUNCTION [ANY, TUPLE, ANY]): ANY Formal arguments:  Supplier Denotes the separate supplier object on which the separate call to function is made.  Function Denotes the function to be evaluated. Return value is of type ANY

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Use of SCOOPLI (2/2) SCOOPSCOOPLI x.f (a) -- a is expandedseparate_routine (x, agent x.f (a)) res := x.g (a) -- g is function and returns -- reference value -- res is non-separate res ?= separate_value (x, agent x.g (a)) i := x.h (a) -- h is function and returns -- expanded value -- res is non-separate i := separate_integer_value (x, agent x.h (a)) -- use function corresponding to returned type: -- boolean_value, integer_value, real_value, -- double_value, char_value if x.count > 0 then...if separate_integer_value (x, agent x.count) > 0 then...

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, SCOOPLI for.NET  Mapping of SCOOP concepts to.NET constructs  Processors  AppDomains  Namespace System.Runtime.Remoting  Use of multithreading  Single feature calls on separate objects, thus one thread per AppDomain  Namespace System.Threading  ThreadPool

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Distributed execution  Processors (AppDomains) located on different machines .NET takes care of the “dirty work”  Marshalling  Minimal cost of inter-AppDomain calls Computer1 AppDomain1 o1 o2 Computer2 AppDomain2 o3 o9 Computer3 AppDomain3 o4 o5 AppDomain4 o6 o7 o8 o9.f o1.g o6.f(o3) o8.g o4.f

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, CCF – Concurrency Control File  Location of processors does not need to be specified at compile time  On-the-fly specification with CCF creation local_nodes: system "susi" (1): "c:\prog\appl1\appl1.exe" "ruth" (1): "c:\prog\appl2\appl2.dll" "schlemmer" (2): "c:\prog\appl3\appl3.dll" end

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Conclusions  SCOOP model is simple yet powerful  Full concurrency  Full use of object-oriented techniques  One keyword separate  Based on Design by Contract™  Several platforms  SCOOPLI library  SCOOP-based syntax  Separate clients, separate suppliers .NET as reference platform  Processors mapped to AppDomains  Distributed execution with.NET Remoting

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Future research  Extension of access control policy  multiple locking of separate objects based on the concept of pure functions  SCOOP for real-time systems  specifying timing constraints  adding priorities to the duel mechanism  Implementation  Use of agents and delegates  Porting of SCOOPLI to.NET CF using threads

2 nd Microsoft Rotor Workshop, Pisa, April 23-25, Questions ? Thank you !