COMP 322 Chapter 5 Deadlock Flashcards

Learn about deadlock

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

Process state blocked

A

A process is blocked on 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

State transitions: A resource request

A

A process p from m units of a resource r creates m new edges directed from p to r.

They can only be issued only when:
1. Process p has no unsatisfied requests and it is not blocked. A blocked process is not running any additional requests.

  1. The number m of request edges plus the k of allocation edges between a process and a resource must not exceed the total amount units of the resource
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State transitions: A resource acquisition

A

a process resource r reverses the direction of the corresponding request edges to point from the units r to p.
It is allowed only when r currently contains the least m free units.

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

State transitions: A resource release

A

Operation by process p of m units of a resource r deletes the m allocation edges between p and r.

Only occurs when:
1. Process p has no unsatisfied requests and it is not blocked.
2. The number of 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

Deadlocked

A

if the process is blocked in a state s and if no matter 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

A state s where s contains two or more deadlock processes.

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

Safe state

A

A state s where if no sequence of state transitions exists that would lead from s to a deadlock state.

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

Deadlock detection (Graph reduction)

A

A deadlock in a resource allocation graph can be detected by executing a graph reduction algorithm.

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

Completely reducible

A

if at the termination 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

Wait-for graph

A

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

A process is blocked on a resource that is currently held by another process.

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

Maximum claim

A

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

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

Resource claim graph

A

It is an extension of a general resource allocation graph.
The extended graph shows:
The current allocation of resources to processes.
All current and all potential future requests by processes for new resources.

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

The banker’s algorithm: (What is it)

A

Emulates the strategy used by a bank when issuing loans.
A loan corresponds to a resource allocation and maximum claim corresponds to the credit limit of a customer (requesting process).

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

The banker’s algorithm: (How it works)

A

1- Given a resource request in a state s, temporarily grants the request by changing the request edges to allocation edges.
2- Execute a graph reduction on the new state s’. (Claim edges are treated as request edges.)
3- If the graph of state s’ is completely reducible then accept s’ as the new state. Otherwise disallow the acquisition by reverting to state s.

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

Single-unit resources

A

With single-unit resources, a process p can be blocked only if p is waiting for a resource held by another blocked process p’

17
Q

Simplified 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, determine if the graph in the temporarily 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.

18
Q

First condition for a deadlock to occur

A

Hold and wait: A process is already holding one resource and is requesting another resource.

19
Q

Second condition for a deadlock to occur

A

Circular wait: A process must issue a resource request that closes a cycle involving at least two processes and two resources.

Both conditions must hold for a deadlock to occur.

20
Q

Eliminating hold and wait

A

There are several alternatives to eliminating the hold and wait condition:

1- Every process must request all resources ever needed at the same time.

2- Every process must release all currently held resources prior to making any new request.

3- A process can be given the ability to test whether a needed resource is currently available.

21
Q

Eliminating circular wait

A

A cycle in the resource graph can be closed when only two or more processes request the same resources but in a different order.

A circular wait is prevented if all processes required to request all resources in the same order.