[MUD-Dev] Re: Java I/O and threads.

cynbe at muq.org cynbe at muq.org
Mon Jan 25 12:02:50 New Zealand Daylight Time 1999


On 25-Jan-99 Jo Dillon wrote:
>   Not necessarily - it depends on your hardware and OS. Java's designed
> to use lots of threads so it's not too much of a worry.
> -- 
>       Jo

But Java is a resource pig at the best of times :( :( :(.

I just came off a year with a company (www.activerse.com) trying to produce
a Java application (Ding!) to compete with C applications (ICQ), and it was
very discouraging.

Be aware that, for example, a seven-char string will eat over 100 bytes of
ram.  Many muds use small strings heavily, so this can be nearly lethal if
resource usage is any sort of concern at all.

The Java GUI libraries, at least, also tend to be rather un threadsafe, in
ways that vary wildly from platform to platform.  I can't speak for the other
Java libraries, but I'd be inclined to suspect the worst until demonstrated

I did look at the no-select()-in-Java problem, and as far as I can tell, there
is indeed no alternative to a thread per active socket.  I'm less optimistic
than Jo that all platforms will handle this nicely, however.  To put it mildly.

Do be sure to assign distinctive names to all your threads, to give yourself at
least a vague chance of debugging the thing.



E-Mail: cynbe at muq.org   PGP Key: http://muq.org/~cynbe/pgp.html

Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv


More information about the MUD-Dev mailing list