[MUD-Dev] Re: OT: Java multithreading performance
vt at freehold.crocodile.org
Sun May 17 22:38:34 New Zealand Standard Time 1998
Chris Gray wrote:
> [Vadim Tkachenko:]
> :Keep static vector of startup delays;
> :Calculate the average delay and print it (for every successful start);
> :while ( isEnabled() ) Thread.sleep( 1000 );
> Any kind of printing is likely to be comparatively very expensive. Good
> would be going to dev/null, best would be no I/O at all.
You've just hit it :-))
I have the logging routine implemented in such a way that it accepts the
messages and prints... well, makes them available to the final logging
device, in the thread runninh with background priority. When I ran this
est, I had to disable all that stuff because the log was becoming silent
after some number of threads (don't remember the exact number, though).
Although, the goal was to test the limits, so I should have had some
sort of logging, otherwise how do I know when it dies? It's possible to
catch the OutOfMemoryError, which I, frankly, expected more than hitting
a thread limit, but I have no clue what would be the system behavior if
JVM wouldn't be able to create the next thread - as far as I understand,
Java language specification doesn't determine the consequences.
> Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Still alive and smile stays on,
Vadim Tkachenko <vt at freehold.crocodile.org>
UNIX _is_ user friendly, he's just very picky about who his friends are
MUD-Dev: Advancing an unrealised future.
More information about the MUD-Dev