Deck 5: Process Synchronization

ملء الشاشة (f)
exit full mode
سؤال
Although the Banker's Algorithm has been used to avoid deadlocks in systems with a few resources,it isn't practical for most systems.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
In the dining philosophers problem,there are five philosophers and four forks.
سؤال
A livelock can be caused by two processes accessing different areas of the same disk.
سؤال
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.
سؤال
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.
سؤال
In general,operating systems must either choose avoidance or recovery as a strategy for dealing with deadlocks.
سؤال
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.
سؤال
A deadlock is preceded by the simultaneous occurrence of six conditions that the operating system (or other systems)could have recognized.
سؤال
Starvation is the result of a policy that liberally allocates resources.
سؤال
According to the Banker's Algorithm,an unsafe state always leads to deadlock.
سؤال
Fixing a deadlock situation requires outside intervention.
سؤال
Deadlock does not usually affect the entire system.
سؤال
A race introduces the element of chance,which is a highly desirable attribute,in database management.
سؤال
Database locking should be done only at the level of the entire database.
سؤال
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.
سؤال
Once starvation has been detected,an algorithm can be implemented in which the system blocks new jobs until the starving jobs have been satisfied.
سؤال
In printing systems using ____,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.

A) phishing
B) lagging
C) spooling
D) spoofing
سؤال
Which of the following is the first step in reducing a directed graph to eliminate deadlock?

A) Remove the process that is holding on to the most resources.
B) Find a process that's waiting only for resource classes that aren't fully allocated
C) Find a process that is currently using a resource and not waiting for one.
D) Find the oldest process and remove it from the graph.
سؤال
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,____

A) sales (P2)doesn't release the inventory file (F1)but requests the supplier file (F2)
B) sales (P2)does release the inventory file (F1)and then requests the supplier file (F2)
C) purchasing (P1)does release the supplier file (F2)which is then requested by sales (P2)
D) purchasing (P1)exits
سؤال
____ developed the Banker's Algorithm.

A) Havender
B) Holt
C) Dijkstra
D) Lane & Mooney
سؤال
In ____ systems,deadlocks can cause critical situations.

A) batch
B) interactive
C) real-time
D) general purpose
سؤال
Deadlock can occur on a printer when ____.

A) the network connection for the printer overflows with too many requests to use the printer
B) too many users attempt to access the printer at the same time
C) the buffer fills up with too many print jobs and the printer cannot decide which one to print
D) 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
سؤال
The Banker's Algorithm is an example of a(n)____ policy.

A) mutual exclusion
B) detection
C) avoidance
D) recovery
سؤال
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.

A) 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.
B) P1 discovers that another process has locked the portion of the disk it needs to access.
C) P2 is put on hold while the control unit moves the arm to satisfy P1's request
D) P1 is unable to find the information it needs,so requests a different READ operation for a different cylinder.
سؤال
____ 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.

A) Mutual exclusion
B) Resource holding
C) No preemption
D) Circular wait
سؤال
____ is the policy of allowing only one process to have access to a dedicated resource.

A) No preemption
B) Circular wait
C) Resource holding
D) Mutual exclusion
سؤال
An algorithm designed to detect starvation by tracking how long each job has been waiting for resources is using the concept of ____.

A) deadlock
B) aging
C) preemption
D) round robin
سؤال
Failure to lock database records before updating them may result in a ____ between processes.

A) struggle
B) race
C) timeout
D) livelock
سؤال
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.

A) P1 requests drive 2.
B) P2 requests drive 2 and gets it.
C) P2 requests drive 1 but is blocked.
D) P1 releases drive 1.
سؤال
____ 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.

A) Mutual exclusion
B) Resource holding
C) Circular wait
D) No preemption
سؤال
The scheme of ____ removes the possibility of a circular wait and therefore guarantees the removal of deadlocks.

A) hierarchical ordering
B) preemption
C) saving and restoring job state
D) requesting all resources before job run
سؤال
In the "dining philosophers" problem,a philosopher can pick up a fork when ____.

A) there is one available
B) there are two available
C) no other philosopher is eating
D) it is his/her turn,going in numerical order from one philosopher to the next
سؤال
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.

A) P2 releases R2.
B) P1 requests R1 again.
C) P1 requests R2,which is locked by P2.
D) P2 releases R1.
سؤال
The first and simplest recovery method,and the most drastic,is to ____.

A) select a nondeadlocked job,preempt the resources it's holding,and allocate them to a deadlocked process so it can resume execution,thus breaking the deadlock
B) identify which jobs are involved in the deadlock and terminate them one at a time,checking to see if the deadlock is eliminated after each removal
C) terminate only the jobs involved in the deadlock and ask their users to resubmit them
D) terminate every job that's active in the system and restart them from the beginning
سؤال
Assume that the events in the accompanying narrative take place.Which of the following statements is true?

A) There is no deadlock.
B) Event 4 caused deadlock.
C) Event 5 caused deadlock.
D) Event 6 caused deadlock.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/39
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Process Synchronization
1
Although the Banker's Algorithm has been used to avoid deadlocks in systems with a few resources,it isn't practical for most systems.
True
2
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
3
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.
True
4
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
5
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
6
In the dining philosophers problem,there are five philosophers and four forks.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
7
A livelock can be caused by two processes accessing different areas of the same disk.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
8
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
9
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
10
In general,operating systems must either choose avoidance or recovery as a strategy for dealing with deadlocks.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
11
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
12
A deadlock is preceded by the simultaneous occurrence of six conditions that the operating system (or other systems)could have recognized.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
13
Starvation is the result of a policy that liberally allocates resources.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
14
According to the Banker's Algorithm,an unsafe state always leads to deadlock.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
15
Fixing a deadlock situation requires outside intervention.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
16
Deadlock does not usually affect the entire system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
17
A race introduces the element of chance,which is a highly desirable attribute,in database management.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
18
Database locking should be done only at the level of the entire database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
19
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
20
Once starvation has been detected,an algorithm can be implemented in which the system blocks new jobs until the starving jobs have been satisfied.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
21
In printing systems using ____,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.

A) phishing
B) lagging
C) spooling
D) spoofing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following is the first step in reducing a directed graph to eliminate deadlock?

A) Remove the process that is holding on to the most resources.
B) Find a process that's waiting only for resource classes that aren't fully allocated
C) Find a process that is currently using a resource and not waiting for one.
D) Find the oldest process and remove it from the graph.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
23
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,____

A) sales (P2)doesn't release the inventory file (F1)but requests the supplier file (F2)
B) sales (P2)does release the inventory file (F1)and then requests the supplier file (F2)
C) purchasing (P1)does release the supplier file (F2)which is then requested by sales (P2)
D) purchasing (P1)exits
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
24
____ developed the Banker's Algorithm.

A) Havender
B) Holt
C) Dijkstra
D) Lane & Mooney
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
25
In ____ systems,deadlocks can cause critical situations.

A) batch
B) interactive
C) real-time
D) general purpose
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
26
Deadlock can occur on a printer when ____.

A) the network connection for the printer overflows with too many requests to use the printer
B) too many users attempt to access the printer at the same time
C) the buffer fills up with too many print jobs and the printer cannot decide which one to print
D) 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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
27
The Banker's Algorithm is an example of a(n)____ policy.

A) mutual exclusion
B) detection
C) avoidance
D) recovery
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
28
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.

A) 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.
B) P1 discovers that another process has locked the portion of the disk it needs to access.
C) P2 is put on hold while the control unit moves the arm to satisfy P1's request
D) P1 is unable to find the information it needs,so requests a different READ operation for a different cylinder.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
29
____ 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.

A) Mutual exclusion
B) Resource holding
C) No preemption
D) Circular wait
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
30
____ is the policy of allowing only one process to have access to a dedicated resource.

A) No preemption
B) Circular wait
C) Resource holding
D) Mutual exclusion
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
31
An algorithm designed to detect starvation by tracking how long each job has been waiting for resources is using the concept of ____.

A) deadlock
B) aging
C) preemption
D) round robin
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
32
Failure to lock database records before updating them may result in a ____ between processes.

A) struggle
B) race
C) timeout
D) livelock
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
33
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.

A) P1 requests drive 2.
B) P2 requests drive 2 and gets it.
C) P2 requests drive 1 but is blocked.
D) P1 releases drive 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
34
____ 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.

A) Mutual exclusion
B) Resource holding
C) Circular wait
D) No preemption
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
35
The scheme of ____ removes the possibility of a circular wait and therefore guarantees the removal of deadlocks.

A) hierarchical ordering
B) preemption
C) saving and restoring job state
D) requesting all resources before job run
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
36
In the "dining philosophers" problem,a philosopher can pick up a fork when ____.

A) there is one available
B) there are two available
C) no other philosopher is eating
D) it is his/her turn,going in numerical order from one philosopher to the next
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
37
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.

A) P2 releases R2.
B) P1 requests R1 again.
C) P1 requests R2,which is locked by P2.
D) P2 releases R1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
38
The first and simplest recovery method,and the most drastic,is to ____.

A) select a nondeadlocked job,preempt the resources it's holding,and allocate them to a deadlocked process so it can resume execution,thus breaking the deadlock
B) identify which jobs are involved in the deadlock and terminate them one at a time,checking to see if the deadlock is eliminated after each removal
C) terminate only the jobs involved in the deadlock and ask their users to resubmit them
D) terminate every job that's active in the system and restart them from the beginning
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
39
Assume that the events in the accompanying narrative take place.Which of the following statements is true?

A) There is no deadlock.
B) Event 4 caused deadlock.
C) Event 5 caused deadlock.
D) Event 6 caused deadlock.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.