This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another help

 
wang jie
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will the setPriority and exits synchronized code directly cause a thread to stop executing?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, I haven't been able to find any documentation to back this up, but I believe that neither case will cause a thread to stop executing.
Corey
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It makes no sense for exiting a synchronized region to force a thread to stop executing. All a synchronized region says is "at the moment I need exclusive access to the object". The thread still has work to do when it isn't in a sync region, so there is no reason to force it to stop executing.
There really aren't any solid guarantees made about what priority even means, so there is no reason why changing it would force a thread to stop executing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic