Deadlock Flashcards

1
Q

What kind of resources can be taken away?

A

Preemptive resources

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

What kind of resources cannot be taken away?

A

Non-preemptive resources

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

A set of processes is ________ if each process in the set is waiting for an event that only another process in the set can cause.

A

deadlocked

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

when utilizing a resource you must ….

A

use a semaphore/mutex to get/release lock on resource.

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

What are the four conditions for deadlock?

A
  1. Mutual Exclusion
  2. Hold and Wait
  3. Non-preemptive resources
  4. Circular Wait
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Deadlock is detected using a ________

A

Resource Allocation Graph (RAG)

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

What algorithm ignores the problems in deadlock?

A

Ostrich Algorithm

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

Once deadlock has been detected the system recovers it by …

  1. ___________ (takes away resources)
  2. ____________ (restores resource to earlier check point)
  3. ____________ (terminates a processes)
A
  1. Preemption
  2. Rollback
  3. Killing Processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe safe and unsafe states.

A

Safe States
- not in deadlock
- there is some scheduling
order, so that all processes
can finish.

Unsafe States
- not necessarily deadlock
- does not guarantee deadlock
- but cannot guarantee
deadlock will be avoided.

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

Describe the Bankers Algorithm.

A

If granting a resource/request will lead to an unsafe state, do not grant the request,

if not, then grant the request

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

What are the 4 ways to deal with deadlock?

A
  1. Ostrich Algorithm
  2. Detect & recover
  3. Avoidance
  4. Prevention
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Avoidance involves what?

A

Safe/Unsafe States

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

How do the 4 conditions prevent deadlock

A
  1. Mutual Exclusion
    - spool everything
  2. Hold and Wait
    - request all resources initially
  3. Non-preemptive Resources
    - take resources away
  4. Circular Wait
    - order resources numerically
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe two-phase locking

A

request all resources up front

-if resources abstained, do work
-if not, release what you did get & wait.

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

when avoiding circular wait if a process has a resource _____

A

only allow process to obtain a resource with a higher ID/number, otherwise give up the higher number resource and request “in order”

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