ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) >
Homework-5 Version 0
👤 Author: by 751815618qqcom 2019-10-17 13:03:54
The banker's algorithm, as its name suggests, works in the same way as bank lending.When the process needs resources, it will make a request to the system, and the system has the total number of various resources. The system will judge whether the number of resources requested for a certain class is less than the total number of resources owned by the system.If it is,the process is successfully borrowing ,otherwise, the trial allocation becomes invalid, the system returns to its original state, and the process waits.The system allocates resources requested by each type of process in the same way.

For example,Process p needs k class a resources and the system has b,if a<b,successful distribution,else it is wrong.For n class processes and m class multiple resources, a two-dimensional array can be used.And it calculate in the same way.When the process ends, the borrowed resources are released.

Please login to reply. Login

Reversion History

Loading...
No reversions found.