File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes thread question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "thread question" Watch "thread question" New topic

thread question

Bing Lu
Ranch Hand

Joined: Oct 10, 2000
Posts: 42
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.
Aru Ven
Ranch Hand

Joined: Sep 28, 2000
Posts: 199
Hi Bing,
There is no way to say which thread will get the lock... remeber the behaviour of threads are System/Vendor dependent....
Bing Lu
Ranch Hand

Joined: Oct 10, 2000
Posts: 42
So thread priority does not matter?
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
No, it does not. Priority is not a consideration while moving a thread from the waiting state to ready state.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: thread question
It's not a secret anymore!