Deadlock Flashcards
Name and explain the two types of correctness properties for concurrent programs
Safety properties - property must always be true e.g. acquire semaphore for access to critical section
Liveness properties - must eventually become true
what are the four conditions that must be satisfied simultaneously for deadlock to occur?
Mutual excl
Hold and wait
No preemption - resource can only be released voluntarily by the threads
circular wait - think circular dependencies
Why can we not remove mutual exclusion (as a condition for deadlock)
Safety is a requirement
why can we not remove hold and wait (as a condition for deadlock)
impractical, low resource utilization, starvation possible
Why can we not remove preemption (as a condition for deadlock)
impractical for most systems - performance issues, primitives are atomic and cannot be interrupted