Back to Browse

Deadlock Prevention & Deadlock Avoidance| Deadlock | Part-2 | Operating System | Bengali Tutorial

699 views
Feb 10, 2022
29:28

Deadlock Prevention vs Deadlock Avoidance ==================================== Prevention provides a set of methods for ensuring that at least one of the necessary conditions cannot hold. Avoidance requires that the OS be given in advance additional information for the processes to decided whether the request can be granted or delayed. Deadlock Prevention ------------------------------------ Deny at least one deadlock characterization condition. Mutual Exclusion – not required for sharable resources; must hold for non-sharable resources.Mutual-exclusion cannot be denied as some resources are intrinsically non-sharable. Hold and Wait – must guarantee that whenever a process requests a resource, it does not hold any other resources. Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none. Low resource utilization; starvation possible. No Preemption – If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released. Preempted resources are added to the list of resources for which the process is waiting. Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting. Circular Wait – impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. Or, to acquire a resource type, relinquish all resources occurring later in the order. Deadlock Avoidance --------------------------------- Requires that the system has some additional a priori information available. Simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need. The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular-wait condition. Resource-allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes. Safe State ------------------------- System is in safe state if there exists a safe sequence. Ref. - Operating System Concepts by - Silberschatz Galvin

Download

1 formats

Video Formats

360pmp461.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Deadlock Prevention & Deadlock Avoidance| Deadlock | Part-2 | Operating System | Bengali Tutorial | NatokHD