The Banker’s algorithm is used A. to rectify deadlock B. to detect deadlock C. to prevent deadlock D. to solve deadlock

to rectify deadlock
to detect deadlock
to prevent deadlock
to solve deadlock

The correct answer is C. to prevent deadlock.

The Banker’s algorithm is a resource allocation algorithm that prevents deadlocks from occurring in a system. It does this by keeping track of the resources that are available and the resources that are currently being used by each process. The algorithm then ensures that no process is ever granted a resource that would cause it to hold resources that other processes need, thus preventing a deadlock from occurring.

Option A is incorrect because the Banker’s algorithm does not rectify deadlocks. Once a deadlock has occurred, the Banker’s algorithm cannot be used to resolve it.

Option B is incorrect because the Banker’s algorithm does not detect deadlocks. The algorithm is designed to prevent deadlocks from occurring, not to detect them after they have occurred.

Option D is incorrect because the Banker’s algorithm does not solve deadlocks. Once a deadlock has occurred, the Banker’s algorithm cannot be used to resolve it.

Exit mobile version