Ch.6 Flashcards
(14 cards)
Structures of a process(4):
- entry section
- critical section
- exit section
- remainder section
Requirements that must be satisfied to every solution in critical section problem(3):
1- mutual exclusion
2- progress
3- bounded waiting
Types of kernel behavior(2):
1- preemptive kernel
2- Non-preemptive kernel
Synchronization tools
1- Peterson solution
2- hardware based
3- mutex locks
4-semaphores
5- monitor
Problems in semaphores
- deadlocks
- starvation
- priority inversion
Classical problems
- bounded waiting
- readers- writers
- dinning philosophers
Problems with semaphores
- incorrect order: single before wait
- double wait: wait wait
- omitting: of wait, signal, or both
Synchronization examples
- windows
- Linux
- Pthreads
Consequence of problems with semaphores:!
Deadlock
Starvation
Types of semaphores
Binary semaphores
Counting semaphores
Condition varicose operations(2):
Wait(): releases the monitor lock
Signal(): wake up one process that previously called x.wait() on the same condition, and if no process is waiting it does nothing
Windows synchronization
- uses interrupt masks to protect access to shared resources
- use spinlocks on multiprocessor systems
- provide dispatcher objects user- land which may act as mutex , semaphores, events, and timers
Linux synchronization
Pre version 2.6 interrupts are disabled to implement short critical sections
Version 2.6 and later—> fully preemptive
Provides: semaphores, atomic integers, spin locks, reader writer versions of both
Pthreads synchronization
Pthreads API is OS independent
Provides: mutex lock, conditions variable
Non portable extensions include: read write lock, spin locks