Java OCA OCP Practice Question 1289

Question

How can you ensure that multithreaded code does not deadlock?

  • A. Synchronize access to all shared variables.
  • B. Make sure all threads yield from time to time.
  • C. Vary the priorities of your threads.
  • D. A, B, and C do not ensure that multithreaded code does not deadlock.


D.

Note

There is no single technique that can guarantee non-deadlocking code.




PreviousNext

Related