Resource Allocation Graph

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello today we are going to see the use of resource allocation graph in a multi processing operating system to detect a dead look first of all let us see what is resource allocation graph a resource allocation graph will contains a following number of nodes a total number of shared resources which are connected with a system and total number of processes which are executing simultaneously by the system and these are the number of edges which souls are allocation of resources to the process as well as a processes which are requesting for more number of resources for the execution now we are going to see why it is required through resource allocation graph it is possible to change the status of the processes which are there in a part of deadlock this is the example of the social occasion graph how it looks like you can see in this resource allocation graph there are three processes process p1 process p2 and process p3 as well as for resources are the shared resources among these three process resource r1 resource r2 resource r3 and resource r4 now in this graph resource r1 and resource r3 these are the two single instance resources it means this particular resources can be allocated to only one process at a time resource r2 and resource R for R the multi instance resources it means which shows r2 can be allocated to two processes at a time as well as resource r4 it can be allocated to three processes at a time now let us check the notations first of all the circle which represent unknown in a resource allocation graph for the processes a square that will be used for resource and inside the square you can see this dough which represent a total number of instances in a particular resource now this is a single instant resource and this one is a multi instant resource that means this resource will be allocated to three processes simultaneously and remaining two and most critically notations in a resource allocation graph that is a direction of arrows in this notation you can see the direction of arrow is there from resource to process it means a resource R has been assigned to process P it means process P is right now accessing this resource R and second one is a totally reverse direction arrow is there from process to resource it means a process P is now requesting to access resource R but still the resource R has not been allocated to process P it is just requesting it may be possible that this resource R will be used for by another process that's why it will not be granted to this particular process so these are the two critical notations and through which we should have to identify the deadlock now let us see a example of resource allocation graph here is the small demonstration of resource allocation graph right now the status is resource r2 is being used by process P 1 that means r2 has been assigned to process p1 next resource r1 has been assigned to process P 2 resource r3 has been assigned to process P 3 now r2 is a multi instant two instances are therefore resource r2 that's why it can be assigned to two processes first of all it has been assigned to process p1 and now it has been assigned to gross as p2 now look at that process p1 is requesting to access resource r1 r1 is a single instance resource and it is already been accessed by p2 that's why the request of process p1 will not be granted process p1 has to wait for resource r1 until and unless it has been completed the task by process p2 same situation for process p2 now it is requesting to use to access resource r3 then it is a single instance resource and this resource has been assigned to process p3 that's why the request of process p2 will not be granted process p2 has to wait for resource r3 now this is what about the current status of resource allocation graph process p1 n process p2 are waiting for resource r1 and r3 whereas resource r1 n r3 has been accessed by this process p2 and p3 respectively and resource r2 which is a multi instance resource that has been accessed by process p1 and p2 so right now process p1 and p2 are in a waiting State and they are waiting for resource r1 and r3 respectively now let us check the further status after completing a process p3 the process p3 has completed his task the source R 3 has been released by process p3 now that resource has been granted to process P 2 that means the request of process P 2 is now accepted but after completing a task of process P 3 but if process P 3 is not completed and then suppose P 3 is also required the use of resource r2 before completion so it will send a request to resource R 2 now all the instances of resource are to occupy by process P 1 and P 2 that means process P 3 has to wait until and unless resource r2 will be released by process P 1 or process P 2 but now you can see process P 1 and P 2 are already in a waiting State so there is a no possibility of releasing a resource r2 by p1 or p2 that means it cannot be allocated to process p3 and that's why process p3 will not be completed and until and unless process p3 will not be completed resource r3 will not be released and until and unless resource r3 is not been released it cannot be occupied to process p2 and process p2 cannot release the resource r1 and until and unless resource r1 will not be released it cannot be occupied to process p1 so in this case all three processes p1 p2 and p3 are in a waiting State process p1 is waiting for resource r1 process p2 is waiting for resource r3 n process p3 is waiting for resource R true so this is a cycle this is a cycle and this cycle shows that process p1 process p2 and process p3 are there in a waiting State and it is a infinite waiting time no one will be released so it is a situation of deadlock so in that way using resource allocation graph we can detect a deadlock that which processes are a part of this particular deadlock situation in this case a cycle is created by all the three processes that's why process p1 p2 and p3 all three processes are a part of deadlock thank you you
Info
Channel: Ajay Ardeshana
Views: 21,769
Rating: 4.7024794 out of 5
Keywords: Ajay Ardeshana
Id: 8S4GAzh7524
Channel Id: undefined
Length: 10min 20sec (620 seconds)
Published: Sat May 21 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.