956 views
0 votes
0 votes
MSQ

 

Which of the following statements is/are TRUE?

  1. If safe state exists, deadlock can be avoided if resources are allocated properly
  2. If safe state exists, deadlock is never possible in future
  3. Unsafe state always leads to a deadlock
  4. Even if safe state exists, deadlock is possible, if resources are poorly allocated
  5. Unsafe state may lead to a deadlock

1 Answer

1 votes
1 votes

The following statements are true:

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

Related questions

0 votes
0 votes
1 answer
3