Friday, April 6, 2012

Principles of Operating System - Lecture 6

producer-consumer problem
producer process
consumer process
buffer(shared)

synchronization between producer and consumer processes


race condition
there is a race condition because of the timing of which process starts first
when two or more processes race for a shared resource and it's unpredictable which one is gonna get first

critical section
race condition might create a situation where the consumer is trying to consume something that has not been produced yet
or
producer is producing so much in the buffer that consumer does not get a chance to consume
or
regional code where we have shared variables

mutual exclusion
only one process at a time can access to critical section

why processes need to communicate?


rules to form critical sections

mutual exclusion problem-starvation

deadlocks

how to implement mutual exclusion

application mutual exclusion

busy wait


mutual exclusion through OS

semaphores operations

producer-consumer problem:solution by semaphores


bounded-buffer problem

what is deadlock

process deadlock
system deadlock


necessary conditions for a deadlock

mutual exclusion
hold&wait
no preemption
circular wait


no deadlock situation?

ostrich algorithm

ways of handling deadlock


deadlock prevention


denying the "hold&wait"

denying "no preemption"

denying "circular wait"


deadlock avoidance


banker's algorithm


classical IPC problems

readers and writers problem

dining philosophers problem

sleeping barber problem


http://www.youtube.com/watch?v=ZMD9vybAjo4&feature=related

No comments:

Post a Comment