------------------------------------------------------ Lecture 06 - February 14, 2003 ------------------------------------------------------ AGENDA: 0 Admin 1 P2 questions? 2 Homework #2 3 Ch 2.3: classical IPC problems 4 Quiz #2 ------------------------------------------------------ 0 - ADMIN ------------------------------------------------------ Startout Q: Why do O/S people care about the dining philosophers? Today: * HM #2 * Quiz #2 Checking of system/library calls for possible failure * soapbox * P1 grade issues ------------------------------------------------------ 1 - P2 QUESTIONS ------------------------------------------------------ Questions? ------------------------------------------------------ 2 - HOMEWORK #2 ------------------------------------------------------ Review/grade homework ------------------------------------------------------ 3 - CH 2.3 - CLASSICAL IPC PROBLEMS ------------------------------------------------------ THE DINING PHILOSOPHERS * describe scenario * discuss problem - it's a "competing for resources" problem * why doesn't fig 2-17 (p. 77) work? * couldn't we do a "down(&mutex)" and "up(&mutex)" around the take_fork() through put_fork() calls? * discuss code for solution fig 2-18 p. 78 - you really have to beat on it yourself until you have persuaded yourself that it works. It does. READERS AND WRITERS * describe scenario * discuss problem - it's a "mutual exclusion/race conditions" problem * discuss possible problem w/ fig 2-19 p. 79 * discuss solution THE SLEEPING BARBER * Similar to reader-writer problem * Probably won't have time to cover in class ------------------------------------------------------ 4 - QUIZ #2 ------------------------------------------------------ As stated. - 10 minutes COS 421 - Lecture Notes #6 SPRING 2003 COS421-lect-2003-02-10.doc Page 1 Printed 14.02.03