Preventing Deadlocks

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

1/8

flashcard set

Earn XP

Description and Tags

flashcards made from Preventing Deadlocks slides from week 9

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

Deadlock Prevention

Deadlock avoidance can only be implemented if there is detailed information about future requests, which is not common

Deadlock prevention can be used in more realistic scenarios

Assure that at least one of the conditions is never satisfied

Mutual exclusion

Hold and wait

No Preemption

Circular wait

2
New cards

Attacking Mutual-Exclusion

If no resource were ever assigned exclusively to a single process, there would never be deadlocks

Yet, this does not work in practice – how can two processes write on the printer at the same time?

However, avoiding assigning a resource unless absolutely necessary is a good idea

3
New cards

Attacking Hold-and-Wait

Preventing processes that hold resources from waiting for more resources, eliminates deadlocks

Requires all processes to request all resources before starting execution

Problem: many processes do not know how many resources they need at the start

4
New cards

Attacking No-Preemption

For resources that are virtualised it is possible to use pre-emption

Not all fit that category

For example, records in databases or tables inside the operating system must be locked to be used and therein lies the potential for deadlock.

5
New cards

Attacking Circular Wait Condition (1)

knowt flashcard image
6
New cards

Attacking Circular Wait Condition (2)

knowt flashcard image
7
New cards

Communication Deadlocks

knowt flashcard image
8
New cards

Livelock

knowt flashcard image
9
New cards

Starvation

If many processes require the same resource, some might never have a chance to use it (starvation), depending on the resource allocation algorithm

Algorithms like first-come, first-served do not cause starvation