Dining Philosophers - Operating Systems - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Operating Systems which includes Sleeping Barber Problem, Waiting Customers, Chair and Sleeps, Barber Is Sleeping, New Customer Arrives, Barber Shop Hints, Customer Threads, Barber Invokes, Thread Invoking etc.Key important points are: Dining Philosophers, Uniprocessor Scheduling, Operating Systems, Deadlock, Thread, Detect Deadlock, Comment, Processor Overhead, Deadlocks Occur Frequently, Scenario

Typology: Slides

2012/2013

Uploaded on 03/27/2013

ekana
ekana 🇮🇳

4

(44)

370 documents

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems
Lecture 16:
Dining Philosophers and
Uniprocessor Scheduling (Chapter 9)
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Dining Philosophers - Operating Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Operating Systems

Lecture 16:

Dining Philosophers and

Uniprocessor Scheduling (Chapter 9)

Problem

  • Consider the following ways of handling deadlock: (1) banker's

algorithm, (2) detect deadlock and kill thread, releasing all

resources, (3) reserve all resources in advance, (4) restart thread

and release all resources if thread needs to wait, (5) resource

ordering, and (6) detect deadlock and roll back thread's actions.

  • One criterion to use in evaluating different approaches to deadlock is which approach permits the greatest concurrency. In other words, which approach allows the most threads to make progress without waiting when there is no deadlock. Give a rank order from 1 to 6 for each of the ways of handling deadlock just listed, where 1 allows the greatest degree of concurrency. Comment on your ordering.
  • Another criterion is efficiency; in other words, which requires the least processor overhead. Rank order the approaches from 1 to 6, with 1 being the most efficient, assuming that deadlock is a very rare event. Comment on your ordering.
  • Does your ordering from (b) change if deadlocks occur frequently? (^2)

The Problem

• Devise a ritual (algorithm) that will allow the

philosophers to eat.

– No two philosophers can use the same fork at the

same time (mutual exclusion)

– No philosopher must starve to death (avoid

deadlock and starvation … literally!)

What's Wrong?

Dining Philosophers: Solution

Chapter 9: Scheduling

11

The Scheduler

  • A module in OS to execute scheduling decisions (for I/O

devices, CPU, etc).

  • The resource provided by a CPU is execution time
  • The aim of processor scheduling is to assign processes

to be executed by the processor over time, in a way that meets system objectives

  • In this section of the course we refer to CPU scheduling

Process State Diagram

Queuing Diagram

Scheduling and

Process State Transitions

Scheduling and

Process State Transitions

Short-Term Scheduling Criteria

• User-oriented scheduling criterion:

– Response Time: elapsed time between the

submission of a request until there is output

• System-oriented scheduling criterion:

– Effective and efficient utilization of the processor

• Performance-related

– Response time and throughput

• Non-performance related

– Predictability: variances as a function of workload