What must the banker's algorithm know a priori in order to prevent deadlock?
Answer:
-The banker's algorithm must calculate whether giving a process a resource will lead to a safe state or not. In order to work, it must know how many resources the process in question may be granted at any one time, and how many resources the OS is able to give. This is difficult because how can we know what future requests might be?
To see if a state is safe – the algorithm checks to see if enough resources exist to satisfy a process. If so, the “loans” are assumed to be “repaid”.