Question 71
HardWhat is an unsafe state?
- A.
A state where a process has crashed
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
What is an unsafe state?
A state where a process has crashed
A state that may lead to deadlock, though it is not necessarily deadlocked
A state with no free resources
A state that is already deadlocked
Sign up free to see the answer and a step-by-step explanation.
What is a livelock?
Processes keep changing state in response to each other but make no progress
A deadlock that resolves itself
A lock held by a dead process
A process stuck waiting for I/O
Sign up free to see the answer and a step-by-step explanation.
Which recovery method does NOT resolve a deadlock?
Pre-empting a resource from one of them
Increasing the priority of all the deadlocked processes
Rolling a process back to a checkpoint
Aborting one of the deadlocked processes
Sign up free to see the answer and a step-by-step explanation.
Why do most general-purpose operating systems ignore deadlocks (the ostrich approach)?
Deadlocks are rare and prevention or avoidance is costly; restarting is cheaper
Deadlocks cannot happen in them
Hardware prevents deadlocks
They use the Banker's algorithm everywhere
Sign up free to see the answer and a step-by-step explanation.
How often should a deadlock-detection algorithm be run?
Depending on how often deadlocks occur and how many processes they affect, e.g. periodically or when CPU use drops
After every instruction
Never
Only at boot
Sign up free to see the answer and a step-by-step explanation.
Spooling a printer breaks which deadlock condition for that printer?
No pre-emption
Hold and wait
Circular wait
Mutual exclusion, since processes no longer hold the printer directly
Sign up free to see the answer and a step-by-step explanation.
A resource-allocation graph has P1 → R1 → P2 → R2 → P1, with one instance of R1 and R2. What is true?
The graph is safe
P1 and P2 are deadlocked
R1 is free
Only P1 is waiting
Sign up free to see the answer and a step-by-step explanation.
What does a wait-for graph show?
Which process waits for which disk block
Which process is waiting for which other process (resources removed)
Memory allocation
The order of CPU scheduling
Sign up free to see the answer and a step-by-step explanation.
Which resource can usually be pre-empted from a process and given back later without harm?
A mutex protecting a half-finished update
A tape drive in the middle of writing
Memory pages, which can be saved to disk and restored
A printer halfway through a job
Sign up free to see the answer and a step-by-step explanation.
What is the time complexity of the Banker's safety check for n processes and m resource types?
O(m + n)
O(2ⁿ)
O(n)
O(m × n²)
Sign up free to see the answer and a step-by-step explanation.