[MUD-Dev] Re: [Java] multithreading: update and a question
Chris Gray
cg at ami-cg.GraySage.Edmonton.AB.CA
Tue Jul 14 22:58:55 CEST 1998
>Any comments about this? What I think about is someone mentioning the
>concept of having a thread pool where the threads can be reused, but if
>the case is many-to-many, this will just create the unnessessary
>overhead (Solaris only).
>From what our company marketing people are hearing, the big guns are
steadily moving the PC world towards multiple CPU's. That suggests that
it is unwise to stick to the single-OS-thread model, since you just
aren't going to get good use of the upcoming machines.
I'd guess that whether or not you want one OS thread per Java thread
would end up depending on how many Java threads you use, and how often
you create and destroy them. If you end up with only about a dozen or
less, than going with native threads each is easy, and will work
fairly well. I think we've talked before about having a pool of
threads that can be used for whatever is needed, without having to go
to the considerable expense of creating and recycling them. If the
Java app really does need dozens of threads active at the same time,
its likely going to be a tad slow no matter how you do it.
If you take the Solaris solution, then in a sense you get the best
of both worlds. With few Java threads, you get an OS thread for each
one, and make good use of multiple CPUs. With many Java threads, you
are limiting the use of OS threads, but still getting your Java app
going. Sounds good to me.
What's the name of the new lighter-weight threads in the new Windows
systems? Perhaps they might be appropriate for Java threads, although
I vaguely recall that there is no pre-emptive switching among them.
>Please consider this as a technical question, not the OS war.
Awwww!
More information about the mud-dev-archive
mailing list