1/3
flashcards made from Deadlocks slides from week 9
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Resources and Deadlocks
• Many resources in a computer system can only be used by one process at a time
– Printers, some backup media, system tables, database records, etc
• Operating systems need to grant exclusive access for these cases
• Some applications need to access several of these resources:
– E.g. Two different processes (A and B) need to save scanned documents to a DVD:
• However, A can request access to the scanner at the same as B requests access to the DVD, hence none can get their missing resource next: Deadlock!
• Deadlocks can also occur across machines or with more than just two processes/devices
Preemptable and Nonpreemptable Resources
• Preemptable resource:
– Can be taken away from the process that is using it without causing issues
– e.g. a process can be temporarily removed from memory
• Non-preemptable resource:
– Cannot be taken away from the process that is using it without potentially causing failure
– e.g. interrupting a record (burn) operation on a DVD will usually cause it to fail
• Normally the resources which are susceptible to be involved in deadlocks are non-preemptable
• In this context, the sequence of events required to use a resource is:
1. Request the resource
2. Use the resource
3. Release the resource
Resource Acquisition (1)
Resource Acquisition (2)