Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling the setPriority method on a thread object...

 
WiLL Tao
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling the setPriority method on a thread objectcan directly cause a thread to stop executing?
And exiting from a synchronized block can cause a thread to stop executing?
I'm confused.Thanks for any help.
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Will,
this question keeps popping up. It is basically a question of wording: Modifying the priority of a thread may (on some systems) cause an executing thread to stop.
This depends on the specific implementation of the JVM: Some JVMs do react to the modification of a thread's priority, others do not.
By searching the archives you may also be able to find more details explanations of this question.
PS: I got the same question several times wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic