Lecture 12 - SysV Semaphores, Monitors, Deadlock
Agenda
Announcements
Lab 5 just about done.
Last look at SysV Semaphore Example and Implementation
Monitors, briefly
Deadlock
Idea
Necessary conditions: mutex, hold and wait, no preemption, circular wait
Resource allocation graphs
Prevention
Avoidance
Banker's Algorithm
Examples
System V Semaphores:
prodcons-sysvsemaphore example
implementation:
/usr/src/sys/kern/sysv_sem.c
One-lane tunnel
Banker's Algorithm Examples