Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 3: Introduction.

Slides:



Advertisements
Similar presentations
Operating Systems Part III: Process Management (Process Synchronization)
Advertisements

Active Shooter Response Training Chance D. Corbett AU Public Safety & Security.
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 1: Eiffel Introduction.
Program correctness The State-transition model A global state S  s 0 x s 1 x … x s m {s k = local state of process k} S0  S1  S2  … Each state transition.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Silberschatz, Galvin and Gagne ©2007 Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Chapter 6 (a): Synchronization.
Operating Systems Operating Systems - Winter 2009 Chapter 2 - Processes Vrije Universiteit Amsterdam.
SPL/2010 Liveness And Performance 1. SPL/2010 Performance ● Throughput - How much work can your program complete in a given time unit? ● Example: HTTP.
Tele Design of Reactive Systems Summer 2001 Prof. Dr. Stefan Leue Institute for Computer Science Albert-Ludwigs-Universität Freiburg
Concurrency.
Race Conditions Critical Sections Deker’s Algorithm.
Skill Building Practice: Adding excitement to the adventure of communication.
Race Conditions Critical Sections Dekker’s Algorithm.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
Avishai Wool lecture Priority Scheduling Idea: Jobs are assigned priorities. Always, the job with the highest priority runs. Note: All scheduling.
Chair of Software Engineering 1 Introduction to Programming Bertrand Meyer Exercise Session 1 22 September 2009.
A Introduction to Computing II Lecture 18: Concurrency Issues Fall Session 2000.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 2: Introduction.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 9.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 9: Contracts and Inheritance (based on work with.
Exercises on Discrete distributions
Multiprocess Synchronization Algorithms ( ) Lecturer: Danny Hendler.
CS211: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Piazza – Textbook Highlight important.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
The Seven Sins of Deadly Meetings by ERIC MATSON Web Article Summary By Aaron Hauber Enlish 393 section 501.
9/8/2015cse synchronization-p1 © Perkins DW Johnson and University of Washington1 Synchronization Part 1 CSE 410, Spring 2008 Computer Systems.
1 Thread Synchronization: Too Much Milk. 2 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing.
Lecture 5 : JAVA Thread Programming Courtesy : MIT Prof. Amarasinghe and Dr. Rabbah’s course note.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
Objective:To understand the nature of maths; especially the distinction with science and possible links to art Hillbilly Maths and Nature by Numbers –
Thread Synchronization Tutorial #8 CPSC 261. A thread is a virtual processor Each thread is provided the illusion that it owns a core – Copy of the registers.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
11/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
Program correctness The State-transition model The set of global states = so x s1 x … x sm {sk is the set of local states of process k} S0 ---> S1 --->
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
Program correctness The State-transition model A global states S  s 0 x s 1 x … x s m {s k = set of local states of process k} S0  S1  S2  Each state.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-5 Process Synchronization Department of Computer Science and Software.
 ALWAYS ACT RESPONSIBLY.  MOST ACCIDENTS HAPPEN WHEN STUDENTS MISBEHAVE.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Synchronization Emery Berger and Mark Corner University.
Technology Walk 2012 Mya Bertke Larissa Evers Nolan Kuenning.
1 Lecture #24 Shared Objects and Concurrent Programming This material is not available in the textbook. The online powerpoint presentations contain the.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Program Correctness. The designer of a distributed system has the responsibility of certifying the correctness of the system before users start using.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Agenda  Quick Review  Finish Introduction  Java Threads.
Sensor Information: while loops and Boolean Logic.
Interprocess Communication Race Conditions
Operating Systems Chapter 2 - Processes Vrije Universiteit Amsterdam
Process Synchronization
PROTOCOL CORRECTNESS Tutorial 3 Theoretical
Threads and Concurrency in Java: Part 2
143a discussion session week 3
Race Conditions Critical Sections Dekker’s Algorithm
CGS 3763 Operating Systems Concepts Spring 2013
Multiprocessor Synchronization Algorithms ( )
Principles of Software Development
Chapter 26 Concurrency and Thread
COMS Prelim 1 Review Session
Critical section problem
Dr. Mustafa Cem Kasapbaşı
Group Mutual Exclusion & Hadzilacos Algorithm
Concurrency: Mutual Exclusion and Process Synchronization
CE 3500 Transportation Engineering Introduction to Roadway Safety
CS 144 Advanced C++ Programming May 7 Class Meeting
CSE 542: Operating Systems
Presentation transcript:

Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 3: Introduction

2 Overview solutions Prisoners: Synchronization Safety vs. Liveness Amdahl’s Law

3 Prisoners: Synchronization I will do nothing. toggle the light switch. announce that all prisoners have been interrogated.

4 Prisoners: Synchronization: Light Off One of the prisoners gets selected as the counter. All non-counting prisoners follow the following protocol. The first time they enter the room when the light is o ff, they turn it on. On all other occasions, they do nothing. The counter follows a di ff erent protocol. The first n − 2 times that the light is on when he enters the room, he turns it o ff. The next time he enters the room when the light is on, he (truthfully) announces that everybody has been interrogated.

5 Prisoners: Synchronization: Light Unknown One of the prisoners gets selected as the counter. All non-counting prisoners follow the following protocol. The first two times they enter the room when the light is o ff, they turn it on. On all other occasions, they do nothing. The counter follows a di ff erent protocol. The first 2n − 3 times that the light is on when he enters the room, he turns it o ff. Then the next time he enters the room when the light is on, he (truthfully) announces that everybody has been interrogated.

6 Safety vs. Liveness safety: Nothing bad happens ever. liveness: Something good happens eventually.

7 Safety vs. Liveness Patrons are served in the order they arrive. What goes up must come down. If two or more processes are waiting to enter their critical sections, at least one succeeds. If an interrupt occurs, then a message is printed within one second. If an interrupt occurs, then a message is printed. The cost of living never decreases. Two things are certain: death and taxes. You can always tell a Harvard man. liveness safety liveness safety liveness safety liveness safety

8 Amdahl’s Law

9 Dining Philosophers: Synchronization