Thanks Henry. I think i got it too
. From what I understood, the difference between the notify() and the notifyAll() is this:
When notifyAll() is called, all the threads waiting on a particular thread object move from the
waiting to the
runnable state.
In the case of the notify() method, only one "lucky" thread moves from waiting to runnable(which one exactly is not predictable). Then, after this "lucky" thread finishes its run() and all the thread cleanup code, notifyAll() is called. Consequently all the threads that were waiting move to runnable.
Is this right?
Cheers,
Roy.
Sun Certified Java Programmer 1.5,
Sun Certified Web Component Developer 5.
"No pain. No Gain"
http://cs.nyu.edu/~rpm319