notify and notifyall
2 posts in topic
Flat View  Flat View

Posted By:   irphan_baig
Posted On:   Thursday, April 21, 2005 08:01 AM

how does notify know which thread has to be invoked first of n number of threads in waiting stage

Re: notify and notifyall

Posted By:   Anonymous  
Posted On:   Monday, May 23, 2005 06:12 AM

Adding to the above reply, the notifyAll() if used inappropriately can cause a serious contention among the threads

Re: notify and notifyall

Posted By:   Victor_Ho  
Posted On:   Wednesday, April 27, 2005 08:50 PM

There is no guarantee in the order as to which thread gets woken up by notify() when there is >1 thread in the "wait on condition" state.

The actual algorithm probably varies across VM implementations.

About | Sitemap | Contact