M11 - Deadlocks

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/27

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

28 Terms

1
New cards

T/F: Deadlock requires mutual exclusion, hold and wait, no preemption, and circular wait conditions to occur.

True

2
New cards

T/F: Preemptible resources, such as RAM, can be released mid-use without causing contention.

True

3
New cards

T/F: A Holt Graph is ineffective for modeling and detecting deadlocks in small resource allocation scenarios.

False

4
New cards

T/F: Depth-First Traversal is the most efficient method to detect cycles in a graph for deadlock detection.

False

5
New cards

T/F: The "Ostrich" method to deadlock management involves intentionally ignoring potential deadlocks because addressing them may not be worth the effort

True

6
New cards

T/F: The Banker's Algorithm is used for deadlock detection in operating systems.

False

7
New cards

T/F: A system state is considered safe if there exists a sequence of processes that allows all processes to complete without entering a deadlock.

True

8
New cards

T/F: In the Banker's Algorithm, it is assumed that resources can fail during allocation.

False

9
New cards

T/F: Deadlock prevention involves strategies such as spooling to avoid mutual exclusion for certain types of resources.

True

10
New cards

T/F: In two-phase locking, locks are acquired and released simultaneously to avoid hold-and-wait conditions

False

11
New cards

T/F: A livelock occurs when processes are stuck in a state where they appear active but fail to make progress.

True

12
New cards

T/F: In a starvation scenario, no processes make progress due to an absence of a scheduling policy.

False

13
New cards

T/F: Deadlock can occur when processes are waiting on events that never happen due to mutual dependencies.

True

14
New cards

T/F: Starvation differs from livelock because some processes make progress in a starvation scenario.

True

15
New cards

T/F: Starvation can occur in systems with bad timing and unfair precedence policies.

True

16
New cards

What are the necessary conditions for a deadlock to occur?

Mutual exclusion - Only one process can use a resource at a time.

Hold and wait - A process holds one resource and waits for another.

No preemption - Resources cannot be forcibly taken from a process.

Circular wait - Processes form a cycle where each process is waiting for a resource held by the next.

17
New cards

What is the "ostrich approach" to deadlock handling?

The "ostrich approach" involves ignoring deadlock issues, assuming they won't occur often enough to justify the cost of addressing them. In case of a deadlock, the system is rebooted to resolve the issue.

18
New cards

How can Holt graphs be used to detect deadlocks?

Holt graphs model processes and resources where arrows represent resource requests and allocations. A cycle in the graph indicates a deadlock, as processes are waiting for resources that are held by other processes in the cycle.

19
New cards

Resource Contention

Conflict over a shared resource between several components

20
New cards

What role do matrices play in detecting deadlocks?

Matrices such as "existing," "current," "available," and "requests" are used to represent the state of resources and processes. By analyzing these matrices, such as by calculating the available resources or comparing requests with available resources, deadlocks can be detected.

21
New cards

What is dynamic avoidance in deadlock management?

Dynamic avoidance involves categorizing states as safe or unsafe. In a safe state, resources can be allocated without causing deadlocks, while in an unsafe state, future allocations may lead to deadlock.

22
New cards

What is the Banker's Algorithm used for in deadlock avoidance?

The Banker's Algorithm ensures resources can be allocated safely by simulating the maximum allocation of resources and determining if a system can proceed without causing deadlocks.

23
New cards

How does the Banker's Algorithm determine if a process can proceed?

The algorithm checks if the available resources, added to the resources held by a process, are sufficient for that process to meet its maximum demand. If the result is non-negative, the process can proceed.

24
New cards

What is deadlock prevention?

Deadlock prevention involves designing systems that avoid at least one of the four necessary conditions for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait.

25
New cards

How does spooling help prevent deadlocks?

Spooling eliminates mutual exclusion by storing tasks in a non-exclusive intermediate store (e.g., printer queue), allowing processes to continue without waiting for resource availability, thus preventing deadlocks.

26
New cards

What is two-phase locking in deadlock prevention?

Two-phase locking requires processes to acquire all necessary locks during the "growth" phase and release them during the "shrinking" phase. This prevents non-preemption and ensures resources are released if the process cannot proceed with all its locks.

27
New cards

What is livelock in the context of deadlocks?

A livelock occurs when processes repeatedly fail to acquire locks due to interference from overlapping shared locks, preventing them from completing tasks. Though the processes are alive, they do not make progress, constantly changing states without doing meaningful work.

28
New cards

How does starvation differ from deadlock and livelock?

Starvation occurs when a process never makes progress due to others constantly advancing, typically due to priority or scheduling policies. Unlike deadlock, where processes are stuck, and livelock, where they keep changing states, starvation means the process is perpetually blocked from execution.