Deadlock Flashcards

1
Q

Name and explain the two types of correctness properties for concurrent programs

A

Safety properties - property must always be true e.g. acquire semaphore for access to critical section
Liveness properties - must eventually become true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the four conditions that must be satisfied simultaneously for deadlock to occur?

A

Mutual excl
Hold and wait
No preemption - resource can only be released voluntarily by the threads
circular wait - think circular dependencies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why can we not remove mutual exclusion (as a condition for deadlock)

A

Safety is a requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

why can we not remove hold and wait (as a condition for deadlock)

A

impractical, low resource utilization, starvation possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why can we not remove preemption (as a condition for deadlock)

A

impractical for most systems - performance issues, primitives are atomic and cannot be interrupted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly