The following statements are true:
- If a safe state exists, deadlock can be avoided if resources are allocated properly.
This statement is true. A safe state means that there exists at least one sequence of processes that can complete execution while avoiding a deadlock. If resources are allocated properly, i.e., according to some safe allocation algorithm, then we can ensure that we always remain in a safe state, and hence avoid a deadlock.
- If a safe state exists, deadlock is never possible in the future.
This statement is not true. Even if a system is in a safe state currently, it is still possible for it to enter into a deadlock in the future if resources are not allocated properly. A safe state only guarantees that there exists at least one sequence of processes that can complete execution while avoiding a deadlock. It does not guarantee that a deadlock will never occur in the future.
- An unsafe state always leads to a deadlock.
This statement is not true. An unsafe state is a state in which there is at least one sequence of processes that can lead to a deadlock. However, it is still possible to avoid a deadlock in an unsafe state if resources are allocated properly.
- Even if a safe state exists, deadlock is possible if resources are poorly allocated.
This statement is true. A safe state only guarantees that there exists at least one sequence of processes that can complete execution while avoiding a deadlock. However, if resources are poorly allocated, i.e., not according to some safe allocation algorithm, then we can still end up in a deadlock even if a safe state exists.
- An unsafe state may lead to a deadlock.
This statement is true. An unsafe state is a state in which there is at least one sequence of processes that can lead to a deadlock. Therefore, an unsafe state may lead to a deadlock if the resources are allocated improperly.