ReRe: performance - some details (and shellsort)
Tom Tromey
tromey@cygnus.com
Mon Aug 16 14:27:00 GMT 1999
>>>>> "Norman" == Norman Hendrich <hendrich@tech.informatik.uni-hamburg.de> writes:
Norman> I don't have any idea what the mysterious second thread does,
Norman> except spending CPU cycles.
The main thread sits and waits for all non-daemon threads to exit.
The actual work of the Java program is done in the second thread (and
subsequent threads).
For the POSIX thread implementation the waiting is done via a
condition variable. This shouldn't cause busy-waiting, but maybe it
does on Linux. I haven't looked.
Suggestions for improving this are appreciated, patches even more so.
It might be nice, on thread systems with a compatible notion of
"daemon" threads, to simply make the master thread the main Java
thread and not have any waiting. It might be hard to do this and
still maintain a nice thread abstraction (I haven't looked; or rather
more precisely I looked a long time ago, decided on the current
design, and no longer remember why).
Tom
More information about the Java
mailing list