BANKER'S ALGORITHM




Tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources,
then makes an “s-state” check to test for possible activities.

Characteristics of Banker's Algorithm:


1. Keep many resources that satisfy the requirement of at least one client
2. Whenever a process gets all its resources, it needs to return them in a restricted period.
3. When a process requests a resource, it needs to wait
4. The system has a limited number of resources
5. Advance feature for max resource allocation

Disadvantage of Banker's algorithm:

1. Does not allow the process to change its Maximum need while processing
2. It allows all requests to be granted in restricted time, but one year is a fixed period for that.
3. All processes must know and state their maximum resource needs in advance.

Demo

Steps

Lights

Input

To take input enter space separated value and for new row and for new row enter in the new line with space separated values.

Output

The output will the process safe sequence and if there is a deadlock condition than deadlock status will be shown.

The input given by the user is also shown in the graph.

Lights