chapter Flashcards

1
Q

A deadlocked state occurs whenever ____.
A) a process is waiting for I/O to a device that does not exist
B) the system has no available free resources
C) every process in a set is waiting for an event that can only be caused by another process in the set
D) a process is unable to release its request for a resource after use

A

C- EVERY PROCESS IN A SET IS WAITING FOR AN EVENT THAT CAN ONLY BE CAUSED BY ANOTHER PROCESS IN THE SET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
One necessary condition for deadlock is \_\_\_\_, which states that at least one resource must be held in a nonsharable mode.
A) hold and wait 
B) mutual exclusion 
C) circular wait 
D) no preemption
A

B- MUTUAL EXCLUSION

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

The witness software product is a(n) ____.
A) lock-order verifier that uses mutual-exclusion locks to protect critical sections
B) modeler to develop resource allocation graphs
C) driver that can be used to prevent mutual exclusion for nonsharable resources
D) implementation of the banker’s algorithm available for most operating systems

A

A- LOCK-ORDER VERIFIER THAT USES MUTUAL-EXCLUSION LOCKS TO PROTECT CRITICAL SECTIONS

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

In a system resource-allocation graph, ____.
A) a directed edge from a process to a resource is called an assignment edge
B) a directed edge from a resource to a process is called a request edge
C) a directed edge from a process to resource is called a request edge
D) None of the above

A

C- A DIRECTED EDGE FROM A PROCESS TO A RESOURCE IS CALLED A REQUEST EDGE

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

A cycle in a resource-allocation graph is ____.
A) a necessary and sufficient condition for deadlock in the case that each resource has more than one instance
B) a necessary and sufficient condition for a deadlock in the case that each resource has exactly one instance
C) a sufficient condition for a deadlock in the case that each resource has more than once instance
D) is neither necessary nor sufficient for indicating deadlock in the case that each resource has exactly one instance

A

B- A NECESSARY AND SUFFICIENT CONDITION FOR A DEADLOCK IN THE CASE THAT EACH RESOURCE HAS EXACTLY ONE INSTANCE

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

Which of the following is most often used by operating systems to handle deadlocks?
A) Pretend that deadlocks never occur
B) Use protocols to prevent or avoid deadlocks
C) Detect and recover from deadlocks
D) None of the above

A

A- PRETEND THAT DEADLOCKS NEVER OCCUR

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

Which of the following statements is true?
A) A safe state is a deadlocked state.
B) A safe state may lead to a deadlocked state.
C) An unsafe state is necessarily, and by definition, always a deadlocked state.
D) An unsafe state may lead to a deadlocked state.

A

D- AN UNSAFE STATE MAY LEAD TO A DEADLOCKED STATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
Which of the following data structures in the banker’s algorithm is a vector of length m, where m is the number of resource types?
A) Need 
B) Allocation 
C) Max 
D) Available
A

D- AVAILABLE

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

Describe the four conditions that must hold simultaneously in a system if a deadlock is to occur

A

For a set of processes to be deadlocked:
1- at least one resource must remain in a non-sharable mode
2- a process must hold at least one resource and be waiting to acquire additional resources held by other processes
3- resources in the system cannot be preempted
4- a circular wait has to exist between processes

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

What are the three general ways that a deadlock can be handled?

A

1- A deadlock can be prevented using protocols to ensure that a deadlock will never occur.
2- A system may allow a deadlock to occur, detect it, and recover from it.
3- An operating may just ignore the problem and pretend that deadlocks can never occur.

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

What is the difference between deadlock prevention and deadlock avoidance?

A

Deadlock prevention is a set of methods for ensuring that at least one of the necessary conditions for deadlock cannot hold. Deadlock avoidance requires that the operating system be given, in advance, additional information concerning which resources a process will request and use during its lifetime

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

What is one way to ensure that a circular-wait condition does not occur?

A

One way to ensure that this condition never holds is to impose a total ordering of all resource types and to require that each process requests resources in an increasing order of enumeration. This can be accomplished by assigning each resource type a unique integer number to determine whether one precedes another in the ordering

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

What does a claim edge signify in a resource-allocation graph?

A

A claim edge indicates that a process may request a resource at some time in the future. This edge resembles a request edge in direction but is represented in the graph by a dashed line.

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

Describe a wait-for graph and how it detects deadlock

A

If all resources have only a single instance, then we can define a deadlock-detection algorithm that uses a variant of the resource-allocation graph, called a wait-for graph. We obtain this graph from the resource-allocation graph by removing the resource nodes and collapsing the appropriate edges. To detect deadlocks, the system needs to maintain the wait-for graph and periodically invoke an algorithm that searches for a cycle in the graph.

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

T OR F:

The circular-wait condition for a deadlock implies the hold-and-wait condition.

A

TRUE

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

T OR F:

If a resource-allocation graph has a cycle, the system must be in a deadlocked state.

A

FALSE

17
Q

T OR F:

In some circumstances, a system can be in a frozen state but not in a deadlocked state.

A

TRUE

18
Q

T OR F:

Protocols to prevent hold-and-wait conditions typically also prevent starvation.

A

FALSE

19
Q

T OR F:
The wait-for graph scheme is not applicable to a resource allocation system with multiple instances of each resource type.

A

TRUE