CORNELL CS 4410 - Lecture Notes (33 pages)

Previewing pages 1, 2, 15, 16, 17, 32, 33 of 33 page document View the full content.
View Full Document

Lecture Notes



Previewing pages 1, 2, 15, 16, 17, 32, 33 of actual document.

View the full content.
View Full Document
View Full Document

Lecture Notes

87 views

Lecture Notes


Pages:
33
School:
Cornell University
Course:
Cs 4410 - Operating Systems

Unformatted text preview:

Deadlocks Part II Detection and Recovery Announcements Prelim coming up in two and a half weeks In class Thursday October 16th 10 10 11 25pm 1 hour exam 203 Thurston Closed book no calculators PDAs Bring ID Topics Everything up to and including Thursday October 9th Lectures 1 13 chapters 1 9 8th ed Review Session TBD Homework 3 will be available later today Review Dining Philophers Problem Five chopsticks Five philosophers really cheap restaurant Free for all Philosopher will grab any one they can Need two chopsticks to eat What if all grab at same time Deadlock How to prevent deadlock Make one of them give up a chopstick Hah Eventually everyone will get chance to eat How to avoid deadlock Never let philosopher take last chopstick if no philosopher has two 3 chopsticks afterwards Review requirements for Deadlock Mutual exclusion Only one thread at a time can use a resource Hold and wait Thread holding at least one resource is waiting to acquire additional resources held by other threads No preemption Resources are released only voluntarily by the thread holding the resource after thread is finished with it Circular wait There exists a set T1 Tn of waiting threads T1 is waiting for a resource that is held by T2 T2 is waiting for a resource that is held by T3 Tn is waiting for a resource that is held by T1 4 Techniques for Preventing Deadlock Infinite resources Include enough resources so that no one ever runs out of resources Doesn t have to be infinite just large Give illusion of infinite resources e g virtual memory Examples Brooklyn bridge with 12 000 lanes Never wait Infinite disk space not realistic yet No Sharing of resources totally independent threads Not very realistic Don t allow waiting How the phone company avoids deadlock Call to your Mom in Toledo works its way through the phone lines but if blocked get busy signal Technique used in Ethernet some multiprocessor nets Everyone speaks at once On collision back off and retry Inefficient since have to keep



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?