Dining Philosophers (Diners) Problem - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Dining Philosophers (Diners) Problem

Description:

Dining Philosophers (Diners) Problem definition Chandy and Misra solution extension to drinking philosophers Definition extension to mutual exclusion arbitrary ... – PowerPoint PPT presentation

Number of Views:209
Avg rating:3.0/5.0
Slides: 6
Provided by: mikh156
Category:

less

Transcript and Presenter's Notes

Title: Dining Philosophers (Diners) Problem


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

2
Definition
  • extension to mutual exclusion
  • arbitrary topology
  • each philosopher (process) proceedsthrough the
    following cycle
  • thinking (out of the CS) may remain indefinitely
  • hungry (requesting the CS)
  • eating (executing the CS) has tofinish within
    finite time
  • solution properties
  • safety no two neighborseat 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?

3
Chandy-Misra84 (Hygenic) SolutionSetup
  • 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

4
Chandy-Misra84 (Hygenic) SolutionDetails
  • if diner does not have fork it sends request to
    the neighbor
  • processgives up dirty forksand holdsclean
  • dinercan onlywait for higherpriority neighbor
  • 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

5
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?
Write a Comment
User Comments (0)
About PowerShow.com