60 likes | 175 Vues
This exercise session led by Prof. Dr. Bertrand Meyer introduces key concepts in concurrent object-oriented programming. Topics covered include synchronization strategies for prisoners, safety versus liveness properties, and understanding Amdahl's Law. Explore winning strategies for prisoner interrogation and analyze safety and liveness properties in a concurrent system. Learn about Amdahl's Law and how it relates to the sequential and parallel fractions of a program and the number of processors.
E N D
Concurrent Object-Oriented ProgrammingProf. Dr. Bertrand Meyer Exercise Session 2: Introduction
Overview • Prisoners: Synchronization • Safety vs. Liveness • Amdahl’s Law
Prisoners: Synchronization • I will • do nothing. • toggle the light switch. • announce that all prisoners have been interrogated.
Prisoners: Synchronization • Each prisoner will be interrogated arbitrarily often. More precisely, for any n, eventually each of the prisoners will be interrogated at least n times. • If the announcement is true then all of the prisoners will be set free. Otherwise all of them will be executed. • What is a winning strategy?
Safety vs. Liveness • safety: Nothing bad happens ever. • liveness: Something good happens eventually. • example • If two or more processes are waiting to enter their critical sections, at least one succeeds. • Is this a safety or a liveness property? • What is the good / bad thing?
Amdahl’s Law sequential fraction parallel fraction number of processors