Describe the general strategy behind deadlock prevention, and give an example of a
practical deadlock prevention method
Answer:
-Deadlock prevention is theorised on the basis that if one nullifies one of the four conditions for deadlock to occur (mutual exclusion, hold and wait, circular wait and no preemption), a deadlock cannot occur.
-Attacking mutual exclusion and no preemption has no practical basis, so we commonly prevent the circular wait condition. We do this by globally numbering all resources. (e.g. Blu-Ray drive #1 and USB Hard Drive #2). At every instant – one of the processes will have the highest numbered resource.
-The process holding it will never ask for a lower one, because we only allow processes to access higher numbered resources. Eventually it will finish and free all its resources. All processes can finish.