CS 3733 Operating Systems
Lecture 37 [4/15/98]: Practical Synchronization
Read Section 6.8 of SG and section 8.4 of PUP
- Implementation of using semaphores (SG pages 186-187)
- Synchronization in Solaris 2:
- SunOS
SunOS used critical sections to guard data structures and
raised interrupt level as the synchronization mechanism.
- Solaris 2
- was designed to support real-time and multiprocessors.
- for short code segments uses adaptive mutexes:
- starts as standard semaphore implemented as a spin-lock.
- If data is locked by a currently running thread, the requesting thread
waits
- If data is locked by a thread not in run state, thread blocks
- for complex synchronization in long sections of code uses:
- condition variables - anything long
- reader-writer locks - items that are accessed frequently but usually
only for reading
- System V Semaphores
- Identification in terms of keys: how do you let other processes
know the name of the semaphore?
- Basic structure and relationship to kernel.
- Semaphore operations.
- Semaphore initialization and race conditions.
Skill: Understand how a real operating system might perform internal
synchronization.
Revised 4/13/98