Computer Science 330
Operating Systems
Spring 2012, Siena College
Lecture 9: Semaphores
Date: Tuesday, February 14, 2012
Agenda
- Announcements
- No office hours the remainder of this week, but I should be able
to answer email fairly regularly
- No class Thursday
- No formal lab meeting on Friday, but there is a lab for you
to work on (details next)
- Lab 4 programs
- Hardware support for process synchronization
- atomic test-and-set
- bounded wait using atomic test-and-set
- atomic swap instruction
- Semaphores
- abstract synchronization primitive
- wait/signal semantics
- using to solve the critical section problem
- implementation idea
- POSIX semaphores
- pthreads mutexes
- using as a general synchronization tool
Lecture Assignment 9
Due at the start of class, Tuesday, February 21.
Please submit answers to these questions
either as a hard copy (typeset or handwritten are OK) or by email to
jteresco AT siena.edu by the start of class. Please use a clear subject line
when submitting by email (e.g., CS 330 Lecture
Assignment 9, Joe Student). We will discuss these
questions at the start of class, so no late submissions are
accepted.
- SG&G Exercise 6.10, p. 260 (4 points)
- SG&G Exercise 6.14, p. 261 (4 points)
Examples
- prodcons-shmem
- prodcons-pthreads
Links