Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

thread question

 
Bing Lu
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there's >=two thread waiting for an object's lock, and some
other thread(owner of the lock) comes in saying notify(), which thread will get the lock, can any1 tell me.
thanks
 
Aru Ven
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bing,
There is no way to say which thread will get the lock... remeber the behaviour of threads are System/Vendor dependent....
Aruna
 
Bing Lu
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So thread priority does not matter?
thanks
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it does not. Priority is not a consideration while moving a thread from the waiting state to ready state.
Ajith
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic