Dining Philosophers (Diners) Problem

Slides:



Advertisements
Similar presentations
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Advertisements

Deadlock Prevention, Avoidance, and Detection
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Operating Systems Lecture Notes Deadlocks Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Deadlock Prevention, Avoidance, and Detection.  The Deadlock problem The Deadlock problem  Conditions for deadlocks Conditions for deadlocks  Graph-theoretic.
6. Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources
Snap-stabilizing Committee Coordination Borzoo Bonakdarpour Stephane Devismes Franck Petit IEEE International Parallel and Distributed Processing Symposium.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Deadlock Emery Berger and Mark Corner University of Massachusetts.
Dining Philosophers (Diners) Problem n definition n Chandy and Misra solution n extension to drinking philosophers.
Deadlocks in Distributed Systems Ryan Clemens, Thomas Levy, Daniel Salloum, Tagore Kolluru, Mike DeMauro.
Deadlock CS Introduction to Operating Systems.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 7 – Deadlock and Indefinite Postponement Outline 7.1 Introduction 7.2Examples of Deadlock.
CS 582 / CMPE 481 Distributed Systems
10 Deadlock Example Process 1 Process 2 Resource 1 Resource 2 Process holds the resource Process requests the resource.
CS 450 OPERATING SYSTEMS DEADLOCKS Manju Muralidharan Priya.
CS603 Process Synchronization February 11, Synchronization: Basics Problem: Shared Resources –Generally data –But could be others Approaches: –Model.
Chapter 7 – Deadlock and Indefinite Postponement
Shortest Path Algorithm By Weston Vu CS 146. What is Shortest Paths? Shortest Paths is a part of the graph algorithm. It is used to calculate the shortest.
Monitors CSCI 444/544 Operating Systems Fall 2008.
CS 603 Dining Philosopher’s Problem February 15, 2002.
1 Lecture 9: Synchronization  concurrency examples and the need for synchronization  definition of mutual exclusion (MX)  programming solutions for.
The Problem The Mutual exclusion problem involves the allocation of a single indivisible,nonshareable resource among n users.(U1,U2….,Un). Critical region:The.
1 Deadlock Solutions CS 241 March 28, 2012 University of Illinois.
1 A Mutual Exclusion Algorithm for Ad Hoc Mobile networks Presentation by Sanjeev Verma For COEN th Nov, 2003 J. E. Walter, J. L. Welch and N. Vaidya.
DISTRIBUTED SYSTEMS II A POLYNOMIAL LOCAL SOLUTION TO MUTUAL EXCLUSION Prof Philippas Tsigas Distributed Computing and Systems Research Group.
CIS 720 Asynchronous Message Passing. Asynchronous message passing Send is non-blocking Modeling a channel c: 1.Two variables: sent c, recv c 2.Queue.
Chapter 11 Resource Allocation by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
Deadlock cs550 Operating Systems David Monismith.
Chapter 7 Deadlocks. 7.1 Introduction Deadlock Common approaches to deal with deadlock – Prevention – Avoidance – Detection and recovery.
CS 241 Section Week #7 (10/22/09). Topics This Section  Midterm Statistics  MP5 Forward  Classical Synchronization Problems  Problems.
Anish Arora Ohio State University Mikhail Nesterenko Kent State University Local Tolerance to Unbounded Byzantine Faults.
Anish Arora Ohio State University Mikhail Nesterenko Kent State University Local Tolerance to Unbounded Byzantine Faults.
CIS 720 Asynchronous Message Passing. Dining philosophers problem P 0 : do hungry acquire left and right fork eat release forks sleep od.
Deadlocks Copyright ©: University of Illinois CS 241 Staff1.
Slide 10-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 10.
Operating Systems Unit 4: – Dining Philosophers – Deadlock – Indefinite postponement Operating Systems.
Deadlock CS Introduction to Operating Systems.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Deadlock.
Informationsteknologi Monday, October 1, 2007Computer Systems/Operating Systems - Class 111 Today’s class Deadlock.
Slide 10-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 10.
Deadlock CSE451 Andrew Whitaker. Review: What Can Go Wrong With Threads? Safety hazards  “Program does the wrong thing” Liveness hazards  “Program never.
Process Management Deadlocks.
Deadlock Detection & recovery
Process Synchronization: Semaphores
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Evaluating and Optimizing Stabilizing Dining Philosophers
Deadlocks (part II) Deadlock avoidance – (not reasonable)
Deadlock and Starvation
Chapter 7 – Deadlock and Indefinite Postponement
Deadlocks (part II) Deadlock avoidance – (not reasonable)
Introduction to Operating Systems
Happy Children’s Day.
Monitors Chapter 7.
Kai Bu 06 Deadlock In previous lectures, we discussed a series of solutions to synchronize cooperating.
Introduction to locality sensitive approach to distributed systems
Semaphores Chapter 6.
Monitors Chapter 7.
Conditions for Deadlock
Monitors Chapter 7.
Lecture 22: Intro to Transactions & Logging IV
SE350: Operating Systems Lecture 5: Deadlock.
CSE 380 Lecture Note 12 Insup Lee
Asynchronous Message Passing
CGS 3763 Operating Systems Concepts Spring 2013
Asynchronous Message Passing
Asynchronous Message Passing
Distributed Systems and Concurrency: Synchronization in Distributed Systems Majeed Kassis.
Distributed Mutual eXclusion
CSE 542: Operating Systems
Presentation transcript:

Dining Philosophers (Diners) Problem 7/1/2018 Dining Philosophers (Diners) Problem definition Chandy and Misra solution extension to drinking philosophers

Definition extension to mutual exclusion arbitrary topology 7/1/2018 Definition extension to mutual exclusion arbitrary topology each philosopher (process) proceeds through the following cycle thinking (out of the CS) may remain indefinitely hungry (requesting the CS) eating (executing the CS) has to finish within finite time solution properties safety – no two neighbors eat at the same time liveness – each hungry philosopher eventually eats can a DMX solution be used to solve the diners problem? If yes, would this solution be efficient?

Chandy-Misra[84] (Hygenic) Solution Setup 7/1/2018 Chandy-Misra[84] (Hygenic) Solution Setup each pair of diners share a fork fork is clean before eating, fork is dirty during and after diner cleans the fork only before giving it to neighbor edge between diners u and v is oriented from u to v (u has higher priority) if u holds clean fork v holds dirty fork, fork is in transition from v to u initially, thus oriented graph is acyclic, all forks are dirty

Chandy-Misra[84] (Hygenic) Solution Details 7/1/2018 Chandy-Misra[84] (Hygenic) Solution Details if diner does not have fork – it sends request to the neighbor process gives up dirty forks and holds clean diner can only wait for higher priority neighbor Gets forks my sending a request for the fork – request for fork per CS request only sent once between a pair of procs notice after eating, diner is a source (all his forks are dirty) graph remains acyclic throughout operation acyclic graph has a sink (lowest priority diner), that diner is guaranteed to eat

Extension to Drinking Philosophers 7/1/2018 Extension to Drinking Philosophers definition arbitrary topology each pair of drinking philosophers share a bottle philosopher alternates between being tranquil, thirsty and drinking philosopher may be tranquil indefinitely but drinks only for finite amount of time philosopher may request to drink from an arbitrary subset of adjacent bottles properties two neighbors cannot drink from the same bottle at the same time each thirsty philosopher eventually drinks relation to the other problems can a solution to diners be used to solve the drinking philosophers problem? Can a DMX solution? If yes, are they going to be efficient?