The person I was speaking to was supposing that of lot of change of the
game
data (for example, inventory changes in a MMORPG) will require an update
of
some data on the filesystem. He was considering the blocking access to
the
filesystem as a bottleneck as important as a synchronous network access
could be.
You are probably going to have to use some kind of database for storing
this data, so assuming you choose a standalone relational database server,
such as MySQL or PostgreSQL, it will be the DB server that will be doing
the file system I/O, not Java.
In the documentation I read about threads, the author were not assuming
anything
about that since it is implementation dependant. Do you know where I can
find such information concerning the JVM provided by Sun ? Is there some
API
or some JVM parameters that enable the programmer to change those
setting ?
....
... for example if there is a need
for me to implement the thread pool in Java or not ... if the JVM
provided
by Sun can really handle thousands of threads, then it might be better to
simply not implement in Java my own thread pool.
The BEA JRockit VM is the best for having huge numbers of threads since it
can map multiple Java threads onto a single native thread with its "thin
threads" implementation. This means it can achieve much better
scalability than Sun's VMs, which on Windows are limited to about 4,000
threads and on Linux are limited by a kernel parameter, which by default
is usually around 2,000 if I remember correctly.
A thread-pool such as the one in the java.util.concurrent package in Java
1.5 is preferable to having that many native threads. Aside from the
performance implications of creating and switching between that many
threads, huge numbers of threads require a huge amount of memory since
each thread has it's own stack. The default thread stack size is 256kb,
which means that 4,000 threads would require 1Gb of memory just for the
stacks, without considering all the other objects you will be using and
the JVM overhead). You can reduce this stack size but the smaller you
make it the more likely you are to run into StackOverflowErrors
(particularly if you are using recursion).
Dan.