60 likes | 174 Views
Concurrent Object-Oriented Programming Prof. 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.
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