This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: ReRe: performance - some details (and shellsort)
- To: Norman Hendrich <hendrich@tech.informatik.uni-hamburg.de>
- Subject: Re: ReRe: performance - some details (and shellsort)
- From: Tom Tromey <tromey@cygnus.com>
- Date: Mon, 16 Aug 1999 14:27:16 -0700
- Cc: jsturm@sigma6.com, java-discuss@sourceware.cygnus.com
- References: <jsturm@sigma6.com><199908161559.RAA11172@tech13.informatik.uni-hamburg.de>
>>>>> "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