In: Computer Science
Safe state implies that the processes can be allocated without encountering deadlock. To check whether the system is in a safe state we can use Bankers Algorithm.
Bankers Algorithm :
Step1: Calculate the need of all the processes.
Step2: Select a process and check if its
need of each resource
available
resources, if yes then enter this process into the safe
sequence otherwise go to step 4.
Step3: Update the available resources by adding the available resources with the allocated resources of that process and go to step2
available = available + allocated
Step4: Choose another process and go to step2
If all the processes come in the safe sequence then system is in safe state otherwise it's unsafe.


Hope this helps!!