A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Joined: Apr 30, 2001
Apr 30, 2001 02:49:00
When the notify method is called which thread among the waiting
threads is notified
option 1: the method which first executed wait()
option 2: any thread arbitrarily is chosen and notified
plz reply immed.
Joined: Apr 14, 2001
Apr 30, 2001 08:26:00
I think option 2 is correct.
Joined: Oct 06, 2000
Apr 30, 2001 08:47:00
Hi Riju !
I also agree with Ash.the answer is 2 only.
Check RHE page 234 for more detailed explanation.
It is sorta covered in the
JavaRanch Style Guide
Threads - What will be the correct explination?
How to Monitor Threads?
wait and notify
waiting thread is invoked without calling notify()
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013