P1) (5 pts.) the processes’ states. Describe the sequences of steps that need to
ID: 3838069 • Letter: P
Question
P1) (5 pts.) the processes’ states.
Describe the sequences of steps that need to occur that leads to two processes becoming deadlocked when both processes are using the same HDD (hard disk drive) and DVD drive.
As part of your explanation, reference
P2) (10 pts.) Explain your solution to breaking this type of deadlock applying the four deadlock prevention techniques [MOS 6.6], and the practicality of each.
P1) (5 pts.) the processes’ states.
Describe the sequences of steps that need to occur that leads to two processes becoming deadlocked when both processes are using the same HDD (hard disk drive) and DVD drive.
As part of your explanation, reference
P2) (10 pts.) Explain your solution to breaking this type of deadlock applying the four deadlock prevention techniques [MOS 6.6], and the practicality of each.
Explanation / Answer
A system is a collection of limited resources which a process uses for fulfilling needs of the application.
Resources such as HDD, DVD drive, CPU’s, etc. are used by the processes running on the system. Normally, a process requests the resource, uses it and then releases it as soon as the task is done.
All the application managed resources can be controlled by various synchronization mechanisms like mutexes and srmaphores whereas kernel keep track of the kernel managed resources by using a queue of processes for resourced to become available.
A set of processes experience deadlock when a process is waiting for a resource which is currently being used by some other process in the set, and which could be released only when the current waiting process makes some progress.
Example:
Program 1 requests resource A and receives it.
Program 2 requests resource B and receives it.
Program 1 requests resource B and is queued up, pending the release of B.
Program 2 requests resource A and is queued up, pending the release of A.
There are four conditions that which can result in deadlock:
1.) Hold & Wait - A process is together holding at one or more resource and waiting for one resource that is used by some other process.
2.) No preemption - Once a process is holding a resource, then that resource cannot be taken away from that process until the holding process releases it.
3.) Circular Wait - A set of processes say P0, P1, P2, . . ., PN exist such that every P[ i ] is waiting for P[ ( i + 1 ) % ( N + 1 ) ]
4.) Mutual Exclusion - At least one of the resource is held in a non sharing mode; If some other process do the request for the same resource, then that process must wait for this resource to be released by the other holding process.
2.)
Deadlock can be easily prevented by preventing one of the above four required conditions:
But, resources such as printers, HDD, cdroms need exclusive access by one resource only.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.