Hi again,
Henry Wong posted November 26, 2006 09:59 AM
Burkhard,
You have an internet connection on your bike? I'm impressed ...
Oh, it's just integrated in the radar antenna of the anti-missile system.
No idea on the marine creature on the cover. I was trying to get a Wombat -- because my wife thinks they're soooo cuuuuute !!! -- but got overridden.
I find bush babies even nicer.
Perhaps they wanted a tentacle bearing beast in relation to threads. By the way, I just looked it up, there is a reprint of Haeckels drawings (which I didn't know).
amazon link Is it true that the other Autor didn't like the language being renamed to
Java from it's original name, oak?
Back to threads.
I modified the code a bit to get an output on the alive status of the calculator thread:
With the last line being notifyAll(); it prints (at least on my system)
Thread-1 waiting for the result...
Thread-2 waiting for the result...
Thread-3 waiting for the result...
Total: 4950 - sync thread object calculator-thr. isAlive:
true Total: 4950 - sync thread object calculator-thr. isAlive:
true Total: 4950 - sync thread object calculator-thr. isAlive:
true with notify();
Thread-1 waiting for the result...
Thread-2 waiting for the result...
Thread-3 waiting for the result...
Total: 4950 - sync thread object calculator-thr. isAlive:
true Total: 4950 - sync thread object calculator-thr. isAlive:
false Total: 4950 - sync thread object calculator-thr. isAlive:
false And without a notify:
Thread-1 waiting for the result...
Thread-2 waiting for the result...
Thread-3 waiting for the result...
Total: 4950 - sync thread object calculator-thr. isAlive:
false Total: 4950 - sync thread object calculator-thr. isAlive:
false Total: 4950 - sync thread object calculator-thr. isAlive:
false So with notifyAll the calculator thread notified all before itself was terminated (and before it sends this "terminating notify" as described by Henry). Must be still living when sending this notifyAll.
With notify() it only notified one waiting thread (as it should be) and the other notifies came from this cleaning up process, indicated by the fact that these threads were already dead. And without notify at all, all notifies came from this clean up.
I see dead threads... Yours,
Bu.