10 December 2002ENS Cachan1 Generalized dining philosophers Catuscia Palamidessi, INRIA in collaboration with Mihaela Oltea Herescu, IBM Michael Pilquist,

Slides:



Advertisements
Similar presentations
Distributed Leader Election Algorithms in Synchronous Ring Networks
Advertisements

Impossibility of Distributed Consensus with One Faulty Process
08 April PPS - Groupe de Travail en Concurrence The probabilistic asynchronous -calculus Catuscia Palamidessi, INRIA Futurs, France.
N-Consensus is the Second Strongest Object for N+1 Processes Eli Gafni UCLA Petr Kuznetsov Max Planck Institute for Software Systems.
Operating Systems Mehdi Naghavi Winter 1385.
CS252: Systems Programming Ninghui Li Based on Slides by Prof. Gustavo Rodriguez-Rivera Topic 14: Deadlock & Dinning Philosophers.
Practice Session 7 Synchronization Liveness Deadlock Starvation Livelock Guarded Methods Model Thread Timing Busy Wait Sleep and Check Wait and Notify.
Operating Systems Lecture Notes Deadlocks Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Paris, 3 Dec 2007MPRI Course on Concurrency MPRI – Course on Concurrency Lecture 12 Probabilistic process calculi Catuscia Palamidessi LIX, Ecole Polytechnique.
Liveness and Performance Issues
Snap-stabilizing Committee Coordination Borzoo Bonakdarpour Stephane Devismes Franck Petit IEEE International Parallel and Distributed Processing Symposium.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
1 Concurrency Specification. 2 Outline 4 Issues in concurrent systems 4 Programming language support for concurrency 4 Concurrency analysis - A specification.
Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova.
SPL/2010 Liveness And Performance 1. SPL/2010 Performance ● Throughput - How much work can your program complete in a given time unit? ● Example: HTTP.
Probabilistic Methods in Concurrency Lecture 9 Other uses of randomization: a randomized protocol for anonymity Catuscia Palamidessi
Bangalore, 2 Feb 2005Probabilistic security protocols 1 CIMPA School on Security Specification and verification of randomized security protocols Lecture.
Probabilistic Methods in Concurrency Lecture 3 The pi-calculus hierarchy: separation results Catuscia Palamidessi
Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous.
Starvation and Deadlock
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Ken Birman. Dining Philosophers A problem that was invented to illustrate some issues related to synchronization with objects Our focus here is on the.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Randomized and Quantum Protocols in Distributed Computation Michael Ben-Or The Hebrew University Michael Rabin’s Birthday Celebration.
EXPANDER GRAPHS Properties & Applications. Things to cover ! Definitions Properties Combinatorial, Spectral properties Constructions “Explicit” constructions.
Transaction Processing: Concurrency and Serializability 10/4/05.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
CS 603 Dining Philosopher’s Problem February 15, 2002.
Intro to OS CUCS Mossé Processes and Threads What is a process? What is a thread? What types? A program has one or more locus of execution. Each execution.
 Jim has six children.  Chris fights with Bob,Faye, and Eve all the time; Eve fights (besides with Chris) with Al and Di all the time; and Al and Bob.
Probabilistic Methods in Concurrency Lecture 4 Problems in distributed systems for which only randomized solutions exist Catuscia Palamidessi
11 February CdP INRIA Futurs Catuscia Palamidessi INRIA Saclay.
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
Distributed Algorithms Lecture 10b – by Ali Ghodsi Fault-Tolerance in Asynchronous Networks – Probabilistic Consensus.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance 3.6. Deadlock prevention.
Christopher Moh 2005 Competition Programming Analyzing and Solving problems.
NC2 (No.4) 1 Undeliverable packets & solutions Deadlock: packets are unable to progress –Prevention, avoidance, recovery Livelock: packets cannot reach.
MPRI – Course on Concurrency Probabilistic methods in Concurrency Catuscia Palamidessi INRIA Futurs and LIX
Probabilistic Anonymity Mohit Bhargava, IIT New Delhi Catuscia Palamidessi, INRIA Futurs & LIX.
MPRI – Course on Concurrency Lectures 11 and 12 The pi-calculus expressiveness hierarchy Catuscia Palamidessi INRIA Futurs and LIX
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
Chapter 11 Resource Allocation by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
14 October BASICS'09, Shanghai On the expressive power of synchronization primitives in the π-calculus Catuscia Palamidessi, INRIA Saclay, France.
Deadlock cs550 Operating Systems David Monismith.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
Operating Systems COMP 4850/CISG 5550 Deadlocks Dr. James Money.
1 Fault tolerance in distributed systems n Motivation n robust and stabilizing algorithms n failure models n robust algorithms u decision problems u impossibility.
Mobile Agent Rendezvous Problem in a Ring Roberta Capuano,Vikas Kumar Jha.
Probabilistic Methods in Concurrency Lecture 6 Progress statements: A tool for verification of probabilistic automata Catuscia Palamidessi
6 October PPDP / GPCE 2002 Mobile Calculi Catuscia Palamidessi, INRIA Futurs, France joint work with Mihaela Herescu, IBM, Austin for Distributed.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. Fast.
Semaphores Chapter 6. Semaphores are a simple, but successful and widely used, construct.
Academic Year 2014 Spring Academic Year 2014 Spring.
Lecture 4 1 Honnor Projects Supervised by Catuscia Palamidessi The  -calculus, a small language for specification and verification of concurrency and.
16 January 2004LIX1 Equipe Comète Concurrency, Mobility, and Transactions Catuscia Palamidessi INRIA-Futurs and LIX.
Stochastic Streams: Sample Complexity vs. Space Complexity
Deadlock Detection & recovery
Catuscia Palamidessi, INRIA Saclay, France
Computability and Complexity
Concurrency Specification
CSE 421: Introduction to Algorithms
Complexity 6-1 The Class P Complexity Andrei Bulatov.
Liveness And Performance
Assignment 6 Recitation
Probabilistic Methods in Concurrency Lecture 7 The probabilistic asynchronous p-calculus Catuscia Palamidessi
CENG334 Introduction to Operating Systems
Presentation transcript:

10 December 2002ENS Cachan1 Generalized dining philosophers Catuscia Palamidessi, INRIA in collaboration with Mihaela Oltea Herescu, IBM Michael Pilquist, PSU

10 December 2002ENS Cachan2 Plan of the talk What we mean by “Generalized dining philosophers” two levels of generalization Motivations The classic deadlock-free solution by Lehmann and Rabin Problems with the classic solution fairness assumption adversaries restrictions on the connection structure A solution for the first generalization (w/o the fairness assumption) A solution for the second generalization (w/ fairness assumption).

10 December 2002ENS Cachan3 Dining Philosophers: classic case Each philosopher needs exactly two forks Each fork is shared by exactly two philosophers

10 December 2002ENS Cachan4 Dining Phils: generalization 1 Each phil still needs two forks, but Each fork can now be shared by more than two philosophers We will consider arbitrary graphs arcs  philosophers vertices  forks Of course, the problem is interesting when there is at least one cycle

10 December 2002ENS Cachan5 Dining Phils: generalization 2 Each phil needs an arbitrary number of forks Each fork can be shared by an arbitrary number of phils We will consider arbitrary bipartite graphs vertices 1  philosophers vertices 2  forks Of course, the problem is interesting when there is at least one cycle

10 December 2002ENS Cachan6 Intended properties of soln Deadlock freedom ( aka progress): if there is a hungry philosopher, a philosopher will eventually eat Starvation freedom: every hungry philosopher will eventually eat (but we won’t consider this property here) Robustness wrt a large class of adversaries: Adversaries decide who does the next move (schedulers) Fully distributed: no centralized control or memory Symmetric: All philosophers run the same code and are in the same initial state The same holds for the forks

10 December 2002ENS Cachan7 Motivations To model real systems, in which the relation between resources and users may be more complicate than a ring Our main motivation: Distributed and modular implementation of the mixed choice mechanism of the  - calculus (and CCS, CSP etc.) mixed choice : both input and output guards are present (out(a).P1 + in(b).P2) | (in(a).Q1 + out(b).Q2)  P1 | Q1  P2 | Q2 Our approach: use the asynchronous  -calculus (no choice, no output guards) as an intermediate language. The asynchronous  - calculus can be implemented in a distributed, modular way.

10 December 2002ENS Cachan8 Encoding  into  pa Every mixed choice is translated into a parallel comp. of processes corresponding to the branches, plus a lock f The input processes compete for acquiring both its own lock and the lock of the partner The input process which succeeds first, establishes the communication. The other alternatives are discarded P Q R Pi Qi Ri f f f The problem is reduced to a generalized DP problem where each fork (lock) can be adjacent to more than two philosophers (generalization 1). We are interested in progress, i.e. deadlock freedom. S R’i f Si

10 December 2002ENS Cachan9 Encoding  into asynchonous  The requirements on the encoding imply symmetry and full distribution There are many solution to the DP problem, but only randomized solutions can be symmetric and fully distributed. [Lehmann and Rabin 81] - They also provided a randomized algorithm (for the classic case) Hence we have actually considered a probabilistic extension of the asynchronous  for the implementation. Note that the DP problem can be solved in  in a fully distributed, symmetric way [Francez and Rodeh ’80] – they actually use CSP Hence the need for randomization is not a characteristic of our approach: it would arise in any encoding of  into an asynchronous language.

10 December 2002ENS Cachan10 The algorithm of Lehmann and Rabin 1. Think 2. choose first_fork in {left,right} %commit 3. if taken(first_fork) then goto 3 4. take(first_fork) 5. if taken(first_fork) then goto 2 6. take(second_fork) 7. eat 8. release(second_fork) 9. release(first_fork) 10. goto 1

10 December 2002ENS Cachan11 Problems Wrt to our encoding goal, the algorithm of Lehmann and Rabin has two problems: 1. It only works for certain kinds of graphs 2. It works only for fair schedulers Problem 2 however can be solved by replacing the busy waiting in step 3 with suspension. [Duflot, Friburg, Picaronny 2002] – see also Herescu’s PhD thesis

10 December 2002ENS Cachan12 The algorithm of Lehmann and Rabin Modified so to avoid the need for fairness 1. Think 2. choose first_fork in {left,right} %commit 3. if taken(first_fork) then wait 4. take(first_fork) 5. if taken(first_fork) then goto 2 6. take(second_fork) 7. eat 8. release(second_fork) 9. release(first_fork) 10. goto 1

10 December 2002ENS Cachan13 Restriction on the graph Theorem: The algorithm of Lehmann and Rabin is deadlock-free if and only if all cycles are pairwise disconnected There are essentially three ways in which two cycles can be connected:

10 December 2002ENS Cachan14 Proof of the theorem If part) Each cycle can be considered separately. On each of them the classic algorithm is deadlock-free. Some additional care must be taken for the arcs that are not part of the cycle. Only if part) By analysis of the three possible cases. Actually they are all similar. We illustrate the first case taken committed

10 December 2002ENS Cachan15 Proof of the theorem The initial situation has probability p > 0 The scheduler forces the processes to loop Hence the system has a deadlock (livelock) with probability p Note that this scheduler is not fair. However we can define even a fair scheduler which induces an infinite loop with probability > 0. The idea is to have a scheduler that “gives up” after n attempts when the process keep choosing the “wrong” fork, but that increases (by f) its “stubborness” at every round. With a suitable choice of n and f we have that the probability of a loop is p/4

10 December 2002ENS Cachan16 Solution for the Generalization 1 As we have seen, the algorithm of Lehmann and Rabin does not work on general graphs However, it is easy to modify the algorithm so that it works in general The idea is to reduce the problem to the pairwise disconnetted cycles case: Each fork is initially associated with one token. Each phil needs to acquire a token in order to participate to the competition. After this initial phase, the algorithm is the same as the Lemahn & Rabin’s Theorem: The competing phils determine a graph in which all cycles are pairwise disconnected Proof: By case analysis. To have a situation with two connected cycles we would need a node with two tokens.