This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ReRe: performance - some details (and shellsort)


>>>>> "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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]