Chair of Software Engineering OOSC - Summer Semester 2004 1 Object-Oriented Software Construction Bertrand Meyer.

Slides:



Advertisements
Similar presentations
SCOOP: Simple Concurrent Object-Oriented Programming Extend the pure, strongly typed, object-oriented language Eiffel with a general and powerful concurrency.
Advertisements

Threads, SMP, and Microkernels
2 nd Microsoft Rotor Workshop, Pisa, April 23-25, SCOOPLI for.NET: a library for concurrent object-oriented programming Volkan Arslan, Piotr Nienaltowski.
SCOOP on.NET Volkan Arslan Chair of Software Engineering ETH Zurich, Switzerland
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 7: References and Assignment.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer Lecture 3: Abstract Data Types.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
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.
Computer Systems/Operating Systems - Class 8
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
Chair of Software Engineering OOSC Lecture 20 - Concurrency Object-Oriented Software Construction Bertrand Meyer.
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Chair of Software Engineering SCOOP: an introduction Bertrand Meyer Chair of Software Engineering, ETH Zurich, Switzerland
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)
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer Lecture 10: Project Presentation Ilinca.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Threads Clients Servers Code Migration Software Agents Summary
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.
Chair of Software Engineering OOSC - Lecture 4 1 Object-Oriented Software Construction Bertrand Meyer.
SCOOP: Simple Concurrent Object-Oriented Programming Piotr Nienaltowski, Volkan Arslan, Bertrand Meyer presented by: Mark Schall.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering OOSC - Lecture 21 1 Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering ATOT - Lecture 25, 30 June Advanced Topics in Object Technology Bertrand Meyer.
Chair of Software Engineering Avoid a void Bertrand Meyer ©Bertrand Meyer, 2008.
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 OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer Lecture 6: Genericity.
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.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
What is Concurrent Programming? Maram Bani Younes.
Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP.
Chapter 10 Architectural Design
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
B.Ramamurthy9/19/20151 Operating Systems u Bina Ramamurthy CS421.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Advanced Design and System Patterns The Microkernel Pattern.
Contracts for Concurrency - Contracts & Inheritance Aryabrata Basu University of Georgia.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Processes Introduction to Operating Systems: Module 3.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Operating Systems Objective n The historic background n What the OS means? n Characteristics and types of OS n General Concept of Computer System.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
Department of Computer Science and Software Engineering
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Basic Characteristics of Object-Oriented Systems
Scott C. Johnson Lecturer Rochester Institute of Technology Spring 2016.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
SCOOPLI for .NET: a library for concurrent object-oriented programming
Simple Concurrent Object-Oriented Programming
Chapter 4: Multithreaded Programming
Chapter 4: Threads.
What is Concurrent Programming?
What is Concurrent Programming?
What is Concurrent Programming?
Presentation transcript:

Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer

Chair of Software Engineering OOSC - Summer Semester Lecture 24: Concurrent O-O principles

Chair of Software Engineering OOSC - Summer Semester The goal  Provide a practical and general foundation for concurrent and distributed programming, ensuring reliability, reusability availability and extendibility.

Chair of Software Engineering OOSC - Summer Semester The issue  Everyone wants to benefit from concurrency and distribution  Physical (networks, multiprocessors)  Logical (processors, threads)  but applications remain extremely difficult to build, especially to build right.  SCOOP provides:  Generality  Ease of programming  Robustness (including liveness,...)  Availability  Extendibility, reusability

Chair of Software Engineering OOSC - Summer Semester Generality  Provide a simple, general, easy to use concurrency and distribution mechanism for programming concurrent applications:  Internet and Web programming.  Web services, peer-to-peer...  Client-server applications.  Distributed processing.  Multi-threading.  Multiple processes (Unix, Windows 95, Windows NT).

Chair of Software Engineering OOSC - Summer Semester An example: Multithreading  Increasingly popular  Notoriously hard to get right; major mistakes remain in released applications; theoretical pitfalls  Impedance mismatch with O-O programming concepts  Synchronization often achieved by low-level mechanisms “Almaviva”name landlord loved_one O1 “Figaro” O2 “Susanna” O3

Chair of Software Engineering OOSC - Summer Semester Concurrency and objects “I can’t understand why objects [of O-O languages] are not concurrent in the first place”. Robin Milner, 1991

Chair of Software Engineering OOSC - Summer Semester Formulating the question  What is the simplest extension of object technology that will support all forms of concurrent computation — in an elegant, general and efficient way?

Chair of Software Engineering OOSC - Summer Semester Basic O-O mechanism  Feature call (message passing): x.f (a)

Chair of Software Engineering OOSC - Summer Semester Concurrent O-O should be easy! (But: it’s not!)  Analogies between objects/classes and processes/process-types:  General decentralized structure, independent modules.  Encapsulated behavior (a single cycle for a process; any number of routines for a class).  Local variables (attributes of a class, variables of a process or process type).  Persistent data, keeping its value between successive activations.

Chair of Software Engineering OOSC - Summer Semester But the analogy breaks down quickly… ... and leaves room to apparent incompatibilities:  Classes are repositories of services; it is fundamental that they should be able to support more than one.  How will processes serve each other’s requests?  The "inheritance anomaly"

Chair of Software Engineering OOSC - Summer Semester Capturing common behaviors deferred class PROCESS feature live is -- General structure with variants. do from setup until over loop step end finalize end feature {NONE} setup is deferred end over: BOOLEAN is deferred end step is deferred end finalize is deferred end end Why limit ourselves to just one behavior when we can have as many as we want?

Chair of Software Engineering OOSC - Summer Semester A printer mechanism class PRINTER inherit PROCESS rename over as off_line, finalize as stop end feature stop is -- Go off-line. do off_line := True end step is -- Execute individual actions of an iteration step. do start_job process_job finish_job end

Chair of Software Engineering OOSC - Summer Semester A printer mechanism (cont’d) feature {NONE} setup is do … end start_job is do … end process_job is do … end finish_job is do … end

Chair of Software Engineering OOSC - Summer Semester Other possible features print_diagnostics prepare_for_maintenance restart_job

Chair of Software Engineering OOSC - Summer Semester The basic triangle of computation  Computing consists of applying operations to objects; to do so requires the appropriate mechanisms – processors. ActionObject Processor

Chair of Software Engineering OOSC - Summer Semester Separate entities  A call of the form x.f (a) has different semantics when handled by the same or different processors.  Need to declare whether client processor is the same as supplier processor or another. x: separate A  Contrast with the usual x: A  which guarantees handling by same processor.

Chair of Software Engineering OOSC - Summer Semester Consistency rule  In assignment x := y  If the source y is separate, the target x must be separate too.  Same rule for argument passing.

Chair of Software Engineering OOSC - Summer Semester Separate entities and classes b: separate BOUNDED_QUEUE [SOME_TYPE] or: separate class BOUNDED_BUFFER [G] inherit BOUNDED_QUEUE [G] end x: BOUNDED_BUFFER [SOME_TYPE]

Chair of Software Engineering OOSC - Summer Semester Creation  If x is separate, then the creation instruction create x  grabs a new processor, physical or virtual, and assigns it to handle the object.  Also: it is possible to obtain a separate object as the result of a function. So processors can be allocated outside of Eiffel text proper.

Chair of Software Engineering OOSC - Summer Semester Generality  “Separate” declaration does not specify the processor.  Semantic difference between sequential and concurrent computation narrowed down to difference for separate calls:  Precondition semantics  Argument passing semantics  Creation semantics.

Chair of Software Engineering OOSC - Summer Semester Two-level architecture  General-purpose top layer (SCOOP).  Several architecture-specific variants at the bottom layer (SCOOP handles).  Initial handles:.NET remoting; POSIX threads; SCOOP HANDLE nHANDLE 1HANDLE 2

Chair of Software Engineering OOSC - Summer Semester Two-level architecture SCOOP ….NETTHREADS

Chair of Software Engineering OOSC - Summer Semester Predefined constructs and libraries  Define specific details (how many processors...) and scheduling policies through libraries.

Chair of Software Engineering OOSC - Summer Semester Processor assignment  The assignment of actual physical resources to (virtual) processors) is entirely dynamic and external to the software text.  Simple notation: Concurrency Control File (CCF) creation proc1: sales.microsoft.com (2), coffees.whitehouse.gov (5),... proc2: (1),...  Physical resources may be Internet nodes, threads, Unix or Windows processes, etc.

Chair of Software Engineering OOSC - Summer Semester End of lecture 24