I want to know when we notify all threads from a wait() method which thread comes out first ...means it comes through priority or through ageing. sachin.
Jim Baiter
Ranch Hand
Joined: Jan 05, 2001
Posts: 532
posted
0
It's random - there's no determining which will acquire the lock after notifyAll() is called.
ANAND RAMKUMAR
Greenhorn
Joined: Jan 01, 2001
Posts: 8
posted
0
you cannot determine which thread comes out of the wait state and to seek the lock state of the object.ageing is not the concept there.
Peter Haggar
author
Ranch Hand
Joined: Jan 03, 2001
Posts: 106
posted
0
One thing you can do to determine which thread runs after a notifyAll is implement the Specific Notification Pattern found here. Peter Haggar ------------------ Senior Software Engineer, IBM author of: Practical Java