• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!