Which statement correctly contrasts deadlock prevention vs avoidance?

Prepare for the 241 Computer Science Certification Exam with comprehensive flashcards and multiple choice questions. Enhance knowledge with explanations and hints to excel in your test journey!

Multiple Choice

Which statement correctly contrasts deadlock prevention vs avoidance?

Explanation:
Deadlock prevention and avoidance are both proactive strategies, but they approach the problem from different angles. Prevention aims to guarantee that at least one of the four Coffman conditions cannot hold, so a deadlock cannot arise. In practice this often means design decisions like requiring a process to request all needed resources at once or preempting resources and forcing processes to release them, which directly removes a condition such as hold-and-wait or mutual exclusion in certain scenarios. Avoidance, by contrast, monitors resource requests and only grants them if the system can remain in a safe state—one in which there is some sequence of allocations that allows all processes to finish without getting stuck. The Banker's algorithm is a classic example: before giving resources, it checks future possibilities to ensure the system won’t enter an unsafe state that could lead to deadlock. The other options mix up these ideas. Prevention is not limited to removing just circular wait, and avoidance is not simply about timeouts. Deadlock detection is a different approach entirely, where the system continues and then checks for deadlocks after they occur.

Deadlock prevention and avoidance are both proactive strategies, but they approach the problem from different angles. Prevention aims to guarantee that at least one of the four Coffman conditions cannot hold, so a deadlock cannot arise. In practice this often means design decisions like requiring a process to request all needed resources at once or preempting resources and forcing processes to release them, which directly removes a condition such as hold-and-wait or mutual exclusion in certain scenarios.

Avoidance, by contrast, monitors resource requests and only grants them if the system can remain in a safe state—one in which there is some sequence of allocations that allows all processes to finish without getting stuck. The Banker's algorithm is a classic example: before giving resources, it checks future possibilities to ensure the system won’t enter an unsafe state that could lead to deadlock.

The other options mix up these ideas. Prevention is not limited to removing just circular wait, and avoidance is not simply about timeouts. Deadlock detection is a different approach entirely, where the system continues and then checks for deadlocks after they occur.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy