in Operating System edited by
485 views
0 votes
0 votes
I have a Small Doubt whenever in questions of resource allocation suppose we have two independent request R1 and R2 so now

and currently we are in safe state.Say I Fulfilled the request $R1$  so now when i will fulfill for $R2$ will i use the original table before processing $R1$ or the tables after $R1$(Table refer to allocation,Max and Need ).

I guess the table after allocation rt but still not confirmed ?
in Operating System edited by
by
485 views

4 Comments

Since you have fulfilled R1's request, its resources will be freed and added to the available resources table. Now for R2, we take required resources from the available resources table. I hope you get it.
1
1
@Akhilesh Singla,In a way the table after R1. Isn't it?
0
0
Yes, the available resources table after R1.

(Writing the concept below for my own revision)

Allocation Table: Number of instances of different resources allocated to each process.

Max Table: Maximum number of instances of different resources that could be required by all processes.

Need Table: (Max Table - Allocated Table). Created to check if the current resource allocation state would be safe or not in the worst scenario when every process requires all of its Max Table resources.

Available Resources Table is not really a table but a row corresponding to number of instances of each resource currently free to allocate. A process, the one that can satisfy its need from available resources, takes the resources and after its completion it frees up the resources it took from available and the ones it had before. Thus Available Resources Table now has more number of instances of resources than before. This process is repeated until the state is found out to be safe or unsafe.
2
2
After allocating to R1 if the system is in again safe state then you can use the new (allocatina,max,need )table for R2 but if after allocating R1 if it is going to be in unsafe state then you have to use initial (allocating,max,need )table for R2 .
0
0

Please log in or register to answer this question.

Related questions