ch.8 deadlock Flashcards

1
Q

what is a deadlock?

A

occurs when two or more threads are waiting for an event that can only be caused by another process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

what is a preemptable resource?

A

can be taken away from a process without a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a preemptable resource?

A

would cause a problem to fail if taken away

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

starvation

A

an indefinite block of a thread
- all deadlocks cause starvation
- not all starvation are caused by deadlocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the four conditions for deadlock?

A
  1. mutual exclusion, each resource is held at most by one process
  2. hold and wait: a process holding resources can request more resources
  3. no preemption : the system cannot take resources from a process
  4. circular wait: there is a circular chain of 2 or more process where each is waiting for a resource held by the next member of the chain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is live lock?

A

occurs when threads can execute but cannot make progress

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how do we deal with deadlock?

A
  1. prevent mutual exclusion: Ensure that resources don’t need to be held to be used.
    Ex: queue print jobs instead of holding a printer
  2. prevent hold and wait : require processes to request all necessary processes
  3. Design all resources to be preemptable. This is kinda how
    databases work: all transactions can be aborted.
  4. prevent circular wait : Always acquire resources in same order. This is the “systems”
    way
How well did you know this?
1
Not at all
2
3
4
5
Perfectly