Question 51
MediumA process is repeatedly rolled back and restarted, so it never finishes even though the system is not deadlocked. What is this called?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
A process is repeatedly rolled back and restarted, so it never finishes even though the system is not deadlocked. What is this called?
Starvation
Deadlock
Thrashing
Paging
Sign up free to see the answer and a step-by-step explanation.
Which deadlock condition does allowing the OS to take a resource back from a waiting process break?
Mutual exclusion
Hold and wait
No preemption
Circular wait
Sign up free to see the answer and a step-by-step explanation.
Five processes share resources A, B and C. Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,2), P3 (2,1,1), P4 (0,0,2). Maximum need: P0 (5,3,3), P1 (3,2,2), P2 (4,0,2), P3 (2,2,2), P4 (3,3,3). Available: (2,3,2). P1 requests (1, 0, 2). Can the request be granted at once under the Banker's algorithm?
No, it exceeds what is available
No, the request exceeds P1's need
No, the resulting state is unsafe
Yes, the resulting state is safe
Sign up free to see the answer and a step-by-step explanation.
Five processes share resources A, B and C. Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,2), P3 (2,1,1), P4 (0,0,2). Maximum need: P0 (5,3,3), P1 (3,2,2), P2 (4,0,2), P3 (2,2,2), P4 (3,3,3). Available: (2,3,2). P4 requests (3, 3, 0). What happens under the Banker's algorithm?
It is granted at once
The request is invalid because it exceeds P4's maximum
P4 is terminated
P4 must wait, because the request exceeds the available resources
Sign up free to see the answer and a step-by-step explanation.
Five processes share resources A, B, C (10, 5 and 7 instances). Currently available: (3, 3, 2).
| Process | Allocation | Max |
|---|---|---|
| P0 | 0 1 0 | 7 5 3 |
| P1 | 2 0 0 | 3 2 2 |
| P2 | 3 0 2 | 9 0 2 |
| P3 | 2 1 1 | 2 2 2 |
| P4 | 0 0 2 | 4 3 3 |
Which of these is a safe sequence?
P2, P1, P3, P4, P0
P1, P3, P4, P0, P2
P0, P1, P2, P3, P4
P4, P1, P3, P0, P2
Sign up free to see the answer and a step-by-step explanation.
Five processes share resources A, B, C (10, 5 and 7 instances). Currently available: (3, 3, 2).
| Process | Allocation | Max |
|---|---|---|
| P0 | 0 1 0 | 7 5 3 |
| P1 | 2 0 0 | 3 2 2 |
| P2 | 3 0 2 | 9 0 2 |
| P3 | 2 1 1 | 2 2 2 |
| P4 | 0 0 2 | 4 3 3 |
P1 requests (1, 0, 2). Should the Banker's algorithm grant it immediately?
Yes, because the resulting state is still safe
No, because the resulting state is unsafe
No, because the request exceeds P1's maximum
No, because not enough resources are available
Sign up free to see the answer and a step-by-step explanation.
In a resource-allocation graph where some resources have several instances, what does a cycle indicate?
A deadlock is possible but not certain
A deadlock definitely exists
No deadlock is possible
The system is in a safe state
Sign up free to see the answer and a step-by-step explanation.
A system has 6 tape drives, and each process needs at most 2 of them. What is the largest number of processes for which deadlock is impossible?
5
4
3
6
Sign up free to see the answer and a step-by-step explanation.
Which of these strategies PREVENT deadlock (rather than avoid or detect it)? (Select all that apply.)
Requesting resources in a fixed global order
Requesting all resources before starting
The Banker's algorithm
Searching the wait-for graph for cycles
Sign up free to see the answer and a step-by-step explanation.
A deadlock-detection algorithm finds that P1, P2 and P3 are deadlocked. Which recovery choice usually loses the least work?
Abort every process in the system
Wait for the deadlock to clear by itself
Abort the deadlocked processes one at a time, choosing the cheapest victim, until the cycle breaks
Restart the computer
Sign up free to see the answer and a step-by-step explanation.