Deadlock _ AI Flashcards
(40 cards)
What is a deadlock?
Threads waiting for each other’s resources
Impact of deadlock?
Concurrent processes cannot complete
Methods to handle deadlocks?
Prevention, avoidance, detection, recovery
System resources consist of?
Finite resources among competing threads
Resource request sequence?
Request → Use → Release
Resource request via?
System calls (e.g., open/close)
Example deadlock problem?
Dining philosophers
Common sync tools?
Mutex locks and semaphores
Mutual exclusion?
Resource non-sharable
Hold and wait?
Holding and waiting for resources
No pre-emption?
Resources released voluntarily
Circular wait?
Cycle of threads waiting
How many conditions for deadlock?
All four must hold
Resource-allocation graph?
Directed graph of threads/resources
Request edge?
Thread → Resource request
Assignment edge?
Resource → Thread allocated
Threads shown as?
Circles
Resources shown as?
Rectangles with instance dots
No cycle implies?
No deadlock
Cycle implies deadlock when?
Single instance per resource
Cycle with multiple instances?
Deadlock may not occur
Three main approaches?
Ignore, prevent/avoid, detect/recover
Ignoring deadlocks cost?
Cheaper, dev-managed
Goal of prevention?
Prevent a necessary condition