Machine-translated by Google. Questions are authored in English.
Top

Discussion

What thread priority guarantees - which of the following is true?

  • A.A higher-priority thread pre-empts a running lower-priority thread immediately.
  • B.Priorities are enforced exactly on every JVM.
  • C.Thread priorities are advisory.
  • D.A higher-priority thread always runs before any lower-priority runnable thread.

Answer: C

Priority is a hint to the platform's scheduler and its effect varies between JVMs and operating systems; setPriority is also capped by the thread group's maximum. A program whose correctness depends on priority ordering works on one machine and fails on another.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.