------------------------------------------------------ Lecture 15 - March 07, 2003 ------------------------------------------------------ AGENDA: 0 Admin 1 P4 questions 2 P5 presentation 3 Homework #4 4 Finishing up Ch 3.3 (if we get to it!) ------------------------------------------------------ 0 - ADMIN ------------------------------------------------------ Startout Q: How could you set it up so that multiple programs could simultaneously read the [same] data that is coming in over a UNIX serial port (e.g., COM1)? Due today: * HM #4 Due monday: * P4 due ------------------------------------------------------ 1 - P4 QUESTIONS ------------------------------------------------------ Questions? ------------------------------------------------------ 2 - P5 PRESENTATION ------------------------------------------------------ Get back to the startout questions: How could you set it up so that multiple programs could simultaneously read the [same] data that is coming in over a UNIX serial port (e.g., COM1)? How about creating a virtual serial port (e.g., COM1) that could be read from anywhere over the network, thus allowing multiple machines to read from the same port at once? What would be the technical issues? How would you solve those issues? What would be the significant flaws? How could you address those flaws? What interesting O/S issues can get involved? * I/O device control * UNIX server/daemon programming * TCP/IP programming * LAYERS :) * shared memory * threads * object-oriented design in O/S coding? * operation semantics issues Useful ideas contributed by class participants: ----------------------------------------------------- 3 - HM #4 ------------------------------------------------------ Review homework #4 ----------------------------------------------------- 4 - FINISH UP CH 3.3 (IF WE GET TO IT!) ------------------------------------------------------ Attacking the "circular wait" condition Several possibilities * No process can hold more than one resource at any given moment. - Must release current resource to get another. * Global numbering of resources - fig 3-9 p. 174 - all requests must be made in ascending numerical order. - How does this help? - One process always holds the highest numbered resource. It cannot issue any requests that block. It will at some point finish and free up its resources. * Will everybody be happy? - Nope. It avoids deadlock, but some processes will be really disappointed, frustrated, etc. Summary: fig 3-10 p. 175 COS 421 - Lecture Notes #15 SPRING 2003 COS421-lect-2003-03-07.doc Page 3 Printed 07.03.03