Give the 4 conditions necessary for deadlock to occur Give a
Give the 4 conditions necessary for deadlock to occur. Give an example of how 2 of the 4 conditions could be removed from an operating system.
Solution
4 conditions are -
- allocate resource to onlyone process or keep it free (Mutual exclusion)
- No pre- emption due to which a process waits for resource to be released by another process
- a group of processes wait for resources due to a circular fashion of waiting
- processes may keep the resources on hold(Hold and wait condition)
Remove circular wait using a resource allocation graph such that there is no cycle in graph
- to avoid mutual exclusion use bankers algorithm such that multiple processes can share a resource safely.
