In banker's algorithm, which process will be handle first?
process need (A, B)
p1
1, 4
p2
1, 3
avaliable: 2, 4
Is there any order exists?
Answer)
In banker's algorithm, the process will be handle first is the:
p1 with need 1, 4
Since the system has available resources as: 2, 4
After allocation to p1: the resources available would be:
2, 4 – 1, 4 = 1, 0
P2 has to wait for p1 returning the resources to the system.
After this, p1 terminates and returns the resources.
After this p2, can allocate the resources and use them in the above style.
For the order, the correct/efficient one would be:
P1 –p2
But the process can execute p2 –p1 also. So what’s the difference?
The difference is in utilization:
P1 utilizes more resources than p2 and thus if allocated first the B resources are all utilized, which is not the case for p2.
Get Answers For Free
Most questions answered within 1 hours.