Chapter 5: Deadlock Flashcards

1
Q

Resource Allocation Graph

A

shows the current allocation of resources to processes and the current requests by processes for new resources

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

A processes p is blocked if? (resource allocation graph)

A

on a resource r if one or more request edges directed from p to r exist and r does not contain sufficient free units to satisfy all requests.

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

Resource request (req r, m) by process p for m units of resource r

A

Creates m new edges directed from p to r. Only happens when:

  1. Process p has no unsatisfiable requests and thus is not blocked. A blocked process is not running and cannot issue additional requests.
  2. The number m of request edges plus the number k of allocation edges between a process and a resource must not exceed the total number of units of the resource. Exceeding m + k implies erroneous code, where a process failed to perform a release prior
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

resource acquisition (acq r, m) by process p of m units of resource r

A

reverses the direction of the corresponding request edges to point from the units of r to p. No partial allocations are allowed.

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

resource release (rel r, m) by process p of m units of resource r

A

deletes m allocation edges between p and r. Only happens when:

  1. Process p has no unsatisfiable requests and thus is not blocked.
  2. the number m of units to be released must not exceed the total number of units p is currently holding.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

deadlock (state)

A

no matter what state transitions occur in the future, the process remains blocked

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

deadlock state

A

state that contains two or more deadlocked processes

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

safe state

A

State where no sequence of state transitions exists that would lead from the current state to a deadlock state.

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

Graph Reduction Algorithm

A

Repeat until no unblocked process remains in the graph:

  1. Select an unblocked process p.
  2. Remove p, including all request and allocation edges connected to p.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Completely Reducible (graph)

A

A graph where at the end of the graph reduction algorithm all processes have been deleted.

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

Theorem 1 (reducibility of graphs)

A

A state s is a deadlock state if and only if the resource graph of s is not completely reducible.

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

Theorem 2 (reducibility of graphs)

A

All reduction sequences of a given resource allocation graph lead to the same final graph.

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

Continuous deadlock detection (algorithm)

A

If the current operation is a request for a resource and the requesting process p becomes blocked in s’ then execute the graph reduction algorithm until

  • either p is removed from the graph
  • or no unblocked process remains in the graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

wait-for graph

A

A resource allocation graph containing only processes where each process can have multiple incoming resource allocation edges but only one outgoing resource request edge.

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

Theorem (wait-for graph)

A

A cycle in the wait-for graph is a necessary and sufficient condition for deadlock.

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

Maximum claim

A

The set of all resources the process may ever request. Each potential future claim of a resource is represented by dashed edges in the resource allocation graph.

17
Q

resource claim graph

A

An extension of the general resource allocation graph. Shows current allocation and all current/future requests by processes for new resources

18
Q

The banker’s algorithm

A
  1. Given a request for a resource in a state s, temporarily grant the request by changing the request edge to an allocation edge.
  2. Starting with the requesting process p, determine if the graph in the temporary state s’ contains a directed cycle.
  3. If no cycle exists then accept s’ as the new state. Otherwise disallow the acquisition by reverting to the state s.
19
Q

Theorem (safe state)

A

If acquisition operations that do not result in a completely reducible claim graph are not executed then any system state is safe.

20
Q

Perform graph reduction using table

A

To perform graph reduction, each unblocked process p is removed by deleting the corresponding row. The number of available resource units is increased by p’s current allocation for each resource.

21
Q

Execute bankers algorithm using table

A

To execute the Banker’s algorithm, the request by a process p for n units of a resource is tentatively granted: n is subtracted from the current requests, the potential requests and the available units, and is added to the allocations. If the new graph is completely reducible, p’s request is granted. Otherwise the state reverts to the previous state.

22
Q

Conditions for Static Deadlock

A
  1. Hold and wait: A process is already holding one resource and is requesting another resource.
  2. Circular wait: A process must issue a resource request that closes a cycle involving at least two processes and two resources.
23
Q

How to prevent circular wait

A

A process p already holding a resource ri with the sequence number seq(ri) may only request resource rj where seq(ri) < seq(rj).
If all processes follow the rule then circular wait is prevented.