Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

Practice this question and more.


Which strategy can NOT solve a deadlock condition?

  1. Using a timeout

  2. Preemptively taking resources away

  3. Preventing circular waits

  4. Reducing the number of resources

The correct answer is: Preemptively taking resources away

Taking preemptive resources away as a strategy to solve a deadlock condition is not effective because it can lead to starvation, where one process continually takes resources away from another, causing it to never complete its task. Using a timeout, preventing circular waits, and reducing the number of resources are all effective strategies for solving deadlock conditions.