2016329621033 homework5 Version 0 |
|
👤 Author: by 1091959239qqcom 2019-12-11 10:14:50 |
The basic idea of Banker's Algorithm is to judge whether the system is safe and secure before allocating resources. It is the most representative algorithm to avoid deadlock.
A banker has two billion assets.
First developer: 1.5 billion loans have been made and another 300 million are needed due to capital shortage.
Second developer: the loan has reached 500 million yuan, which can be recovered in good operation.
Third developer: 1.8 billion loan
First, wait for the second developer to collect the money, then have 500 million in hand, then lend 300 million to the first developer, wait for the first developer to collect 1.8 billion, and then lend the money to the third developer.