41.Define deadlock.
A process requests resources; if the resources are not available at that time, the process enters a wait state. Waiting processes may never again change state, because the resources they have requested are held by other waiting processes. This situation is called a deadlock.
42.What is the sequence in which resources may be utilized?
Under normal mode of operation, a process may utilize a resource in the following sequence:
• Request: If the request cannot be granted immediately, then the requesting process must wait until it can acquire the resource.
• Use: The process can operate on the resource.
• Release: The process releases the resource.
43.What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold simultaneously in a system:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption
44.What is a resource-allocation graph?
Deadlocks can be described more precisely in terms of a directed graph called a system resource allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes; P the set consisting of all active processes in the system and R the set consisting of all resource types in the system.
45.Define request edge and assignment edge.
A directed edge from process Pi to resource type Rj is denoted by PiàRj; it signifies that process Pi requested an instance of resource type Rj and is currently waiting for that resource. A directed edge from resource type Rj to process Pi is denoted by RjàPi, it signifies that an instance of resource type has been allocated to a process Pi. A directed edge PiàRj is called a request edge. A directed edge RjàPi is called an assignment edge.
46.What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
a. Use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlock state.
b. Allow the system to enter the deadlock state, detect it and then recover.
c. Ignore the problem all together, and pretend that deadlocks never occur in the system.
47.Define deadlock prevention.
Deadlock prevention is a set of methods for ensuring that at least one of the four
necessary conditions like mutual exclusion, hold and wait, no preemption and circular
wait cannot hold. By ensuring that that at least one of these conditions
cannot hold, the occurrence of a deadlock can be prevented.
48.Define deadlock avoidance.
An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. Each request requires the system consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process, to decide whether the could be satisfied or must wait to avoid a possible future deadlock.
49.What are a safe state and an unsafe state?
A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of processes <P1,P2,....Pn> is a safe sequence for the current allocation state if, for each Pi, the resource that Pi can still request can be satisfied by the current available resource plus the resource held by all the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe.
50.What is banker's algorithm?
Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource type.
The two algorithms used for its implementation are:
a. Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.
b. Resource-request algorithm: if the resulting resource allocation is safe, the transaction is completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored.
A process requests resources; if the resources are not available at that time, the process enters a wait state. Waiting processes may never again change state, because the resources they have requested are held by other waiting processes. This situation is called a deadlock.
42.What is the sequence in which resources may be utilized?
Under normal mode of operation, a process may utilize a resource in the following sequence:
• Request: If the request cannot be granted immediately, then the requesting process must wait until it can acquire the resource.
• Use: The process can operate on the resource.
• Release: The process releases the resource.
43.What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold simultaneously in a system:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption
44.What is a resource-allocation graph?
Deadlocks can be described more precisely in terms of a directed graph called a system resource allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes; P the set consisting of all active processes in the system and R the set consisting of all resource types in the system.
45.Define request edge and assignment edge.
A directed edge from process Pi to resource type Rj is denoted by PiàRj; it signifies that process Pi requested an instance of resource type Rj and is currently waiting for that resource. A directed edge from resource type Rj to process Pi is denoted by RjàPi, it signifies that an instance of resource type has been allocated to a process Pi. A directed edge PiàRj is called a request edge. A directed edge RjàPi is called an assignment edge.
46.What are the methods for handling deadlocks?
The deadlock problem can be dealt with in one of the three ways:
a. Use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlock state.
b. Allow the system to enter the deadlock state, detect it and then recover.
c. Ignore the problem all together, and pretend that deadlocks never occur in the system.
47.Define deadlock prevention.
Deadlock prevention is a set of methods for ensuring that at least one of the four
necessary conditions like mutual exclusion, hold and wait, no preemption and circular
wait cannot hold. By ensuring that that at least one of these conditions
cannot hold, the occurrence of a deadlock can be prevented.
48.Define deadlock avoidance.
An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. Each request requires the system consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process, to decide whether the could be satisfied or must wait to avoid a possible future deadlock.
49.What are a safe state and an unsafe state?
A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of processes <P1,P2,....Pn> is a safe sequence for the current allocation state if, for each Pi, the resource that Pi can still request can be satisfied by the current available resource plus the resource held by all the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe.
50.What is banker's algorithm?
Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource type.
The two algorithms used for its implementation are:
a. Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.
b. Resource-request algorithm: if the resulting resource allocation is safe, the transaction is completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored.
No comments:
Post a Comment