Asked by: Gia Katereche
Asked in category: technology and computing, databases
Last Updated: 28th Sep 2023

What is the difference between a safe and unsafe state?

A state of safety means there's no danger of deadlock. Unsafe State does not mean that there has been a deadlock, but it could occur.

Similar to OS, what is considered safe and unsafe in OS?

If the system is able to allocate all resources required by all processes without reaching a deadlock, then a state is considered safe. A system that does not have a safe sequence is considered unsafe and may lead to deadlock.

What is starvation OS, in the same way? Starvation OS is when a process doesn't get the resources it requires for a prolonged time due to resources being allotted to other processes. This is usually caused by a Priority-based scheduling system.

What is an unsafe state, you ask?

If the system can finish execution, it is considered safe . Similar to the above, if the system exists in a safe state then an allocation sequence is available that allows the processes finish executing.

How do deadlocks recover?

Deadlock recovery is used in real-time operating systems. Stopping the process: stopping all processes involved in the Deadlock. Each process must be killed. Once you have killed each process, check for deadlocks again. Continue this process until the system is free from deadlock.