L6-Deadlock

L6-Deadlock - Deadlock CSIS0230A Lecture Six Define...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Deadlock CSIS0230A Lecture Six Define Deadlock Problem Define the conditions of Deadlock Solutions Deadlock prevention Deadlock avoidance Deadlock detection and recovery
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Recommended Reading Chapter 7 of Operating Systems, 3rd edition by Deitel et. al 2 CSIS0230A Principles of Operating Systems
Background image of page 2
References Chapter 7 of Operating Systems, 3rd edition by Deitel et. al Chapter 7 of Operating System Principles, 7th edition by Silberschatz et. al Chapter 11 of Operating Systems - A Concept-Based Approach, 2nd edition by D.M. Dhamdhere Chapter 6 of Operating Systems - Internals and Design Principles, 6th edition by William Stallings 3 CSIS0230A Principles of Operating Systems
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Deadlock Problem 4 CSIS0230A Principles of Operating Systems
Background image of page 4
The Deadlock Problem A set of threads each holding some resources and block waiting to acquire a resource held by another thread in the set. Example System has 2 disk drives. T1 and T2 each holds one disk drive and each needs another one. Example Two binary semaphores A and B 5 T0 T1 wait (A); wait(B) wait (B); wait(A) CSIS0230A Principles of Operating Systems
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Classical Synchronization Problem Dining Philosophers Five philosophers sit around a circular table. Each leads a simple life alternating between thinking and eating spaghetti. In front of each philosopher is a dish of spaghetti that is constantly replenished by a dedicated wait staff. There are exactly five forks on the table, one between each adjacent pair of philosophers. Eating spaghetti (in the most proper manner) requires that a philosopher use both adjacent forks (simultaneously). Develop a concurrent program free of deadlock and indefinite postponement that models the activities of the philosophers. 6 CSIS0230A Principles of Operating Systems
Background image of page 6
Dining Philosophers 7 philosopher while (true) { think(); eat(); } eat() { pickup Left Fork(); pickup Right Fork(); eatingSpaghetti(); putdown Right Fork(); putdown Left Fork(); } CSIS0230A Principles of Operating Systems
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Indefinite postponement Also called indefinite blocking or starvation A process may be delayed indefinitely while other processes could proceed Occurs due to biases in a system’s resource scheduling policies Aging Technique that prevents indefinite
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/01/2010 for the course CS 2342 taught by Professor Dr during the Spring '10 term at HKU.

Page1 / 24

L6-Deadlock - Deadlock CSIS0230A Lecture Six Define...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online