Understanding Operating System CH 5
True
When using a directed graph to model a system, if there's a cycle in the graph, then there is a deadlock involving the processes and the resources shown in the cycle.
True
When using the Banker's Algorithm, an operating system must be sure never to satisfy a request that moves it from a safe state to an unsafe one.
Find a process that is currently using a resource and not waiting for one.
Which of the following is the first step in reducing a directed graph to eliminate deadlock?
False
Database locking should be done only at the level of the entire database.
the printer needs all of a job's output before it will begin printing, but the spooling system fills the available disk space with only partially completed output
Deadlock can occur on a printer when ____.
False
Deadlock does not usually affect the entire system.
True
Deadlock is a system-wide tangle of resource requests that begins when two or more jobs are put on hold, each waiting for a vital resource to become available.
False
Deadlock was a serious problem for early batch systems.
race
Failure to lock database records before updating them may result in a ____ between processes.
P1 requests R2, which is locked by P2.
Fill in the missing event that causes deadlock in a database. There are two processes (P1 and P2), each of which needs to update two records (R1 and R2) and the following sequence leads to a deadlock: 1. P1 accesses R1 and locks it. 2. P2 accesses R2 and locks it. 3. ____ 4. P2 requests R1, which is locked by P1.
While the control unit is moving the arm to cylinder 20, P1 is put on hold and the I/O channel is free to process the next I/O request.
Fill in the missing event that causes livelock. At an insurance company, the system performs many daily transactions. One day, the following series of events ties up the system: 1. Process P1 wishes to show a payment, so it issues a command to read the balance, which is stored in cylinder 20 of a disk pack. 2. ____ 3. P2 gains control of the I/O channel and issues a command to write someone else's payment to a record stored in cylinder 310. If the command is not "locked out," P2 will be put on hold while the control unit moves the arm to cylinder 310. 4. Because P2 is "on hold," the channel is free to be captured again by P1, which reconfirms its command to "read from cylinder 20." 5. Since the last command from P2 had forced the arm mechanism to cylinder 310, the disk control unit begins to reposition the arm to cylinder 20 to satisfy P1. The I/O channel would be released because P1 is once again put on hold, so it could be captured by P2, which issues a WRITE command only to discover that the arm mechanism needs to be repositioned.
P2 requests drive 2 and gets it.
Fill in the missing step in the following deadlock situation. Two users from the local board of education are each running a program (P1 and P2), and both programs will eventually need two DVD drives to copy files from one disc to another. Only two DVD-R drives are available and they're allocated on an "as requested" basis. Soon the following sequence transpires: 1. P1 requests drive 1 and gets it. 2. ____ 3. P1 requests drive 2 but is blocked. 4. P2 requests drive 1 but is blocked.
True
If locks are not used to preserve data integrity, the updated records in a database may include only some of the data—and their contents depend on the order in which each process finishes its execution.
True
Once starvation has been detected, an algorithm can be implemented in which the system blocks new jobs until the starving jobs have been satisfied.
True
One problem with the Banker's Algorithm is that because the algorithm assumes the worst case, vital resources can be unavailable in order to guard against unsafe states.
Mutual Exclusion
one of four conditions for deadlock in which only one process is allowed to have access to resource.
Circular Wait
one of four conditions for deadlock through which each process involved is waiting for a resource being held by another; each process is blocked and can't continue resulting in a deadlock.
avoidance
The Banker's Algorithm is an example of a(n) ____ policy.
There is no deadlock.
The Printer Event 1 P1 requests and is allocated the printer R1. 2 P1 releases the printer R1. 3 P2 requests and is allocated the disk drive R2. 4 P2 releases the disk R2. 5 P3 requests and is allocated the plotter R3. 6 P3 releases the plotter R3. 12. Assume that the events in the accompanying narrative take place. Which of the following statements is true?
True
To recover from deadlock, a factor that is commonly considered when selecting a victim is the CPU time used by a job - jobs close to completion are usually left alone.
False
A deadlock is preceded by the simultaneous occurrence of six conditions that the operating system (or other systems) could have recognized.
True
A livelock can be caused by two processes accessing different areas of the same disk.
False
A race introduces the element of chance, which is a highly desirable attribute, in database management.
False
According to the Banker's Algorithm, an unsafe state always leads to deadlock.
True
All recovery algorithms have one feature in common: they all require at least one victim, which, when removed from the deadlock, will free the system.
True
Although the Banker's Algorithm has been used to avoid deadlocks in systems with a few resources, it isn't practical for most systems.
aging
An algorithm designed to detect starvation by tracking how long each job has been waiting for resources is using the concept of ____.
sales (P2) doesn't release the inventory file (F1) but requests the supplier file (F2)
Consider the case of a home construction company with two application programs, purchasing (P1) and sales (P2), which are active at the same time. They each need to access two files, inventory (F1) and suppliers (F2), to update daily transactions. The following series of events will cause a deadlock. Fill in the missing event in the sequence. 1. Purchasing (P1) accesses the supplier file (F2). 2. Sales (P2) accesses the inventory file (F1). 3. Purchasing (P1) doesn't release the supplier file (F2) and requests the inventory file (F1), but P1 is blocked because F1 is being held by P2. 4. Meanwhile, ____
real-time
In ____ systems, deadlocks can cause critical situations.
False
In general, operating systems must either choose avoidance or recovery as a strategy for dealing with deadlocks.
there are two available
In the "dining philosophers" problem, a philosopher can pick up a fork when ____.
False
In the dining philosophers problem, there are five philosophers and four forks.
True
Resource holding, where a job holds on to one resource while waiting for another one that's not yet available, can be sidestepped by forcing each job to request, at creation time, every resource it will need to run to completion.
False
Starvation is the result of a policy that liberally allocates resources.
terminate every job that's active in the system and restart them from the beginning
The first and simplest recovery method, and the most drastic, is to ____.
hierarchical ordering
The scheme of ____ removes the possibility of a circular wait and therefore guarantees the removal of deadlocks.
Dijkstra
____ developed the Banker's Algorithm.
Mutual exclusion
____ is necessary in any computer system because some resources such as memory, CPU, and dedicated devices must be exclusively allocated to one user at a time.
Mutual exclusion
____ is the policy of allowing only one process to have access to a dedicated resource.
Circular wait
____ is when each process involved in an impasse is waiting for another to voluntarily release its resources so that at least one process will be able to continue.
Spooling
____ is when, in modern printing systems, a disk accepts output from several users and acts as a temporary storage area for all output until the printer is ready to accept it.
Holt
____ published a visual tool to show how deadlock conditions can be modeled using directed graphs.
Livelock
a lock system whereby two or more processes continually block the forward progress of the others without making any forward progress themselves. It is similar to a deadlock except that neither process is blocked or obviously waiting; both are in a continuous state of change.
Deadlock
a problem occurring when the resource need by jobs to finish execution are held by other jobs, which, in turn, are waiting for other resources to become available.
Starvation
the result of conservative allocation in which a single job is prevented from execution because it's kept waiting for resources that never become available.