I want an exception about multi-dimensional design in Java between thread-per-character and thread-per-map / zone . Which is more profitable (or otherwise) and the game server can control 3000+ players.
None of them are going to provide you great scalability Threads take a little space - eg . By default the stack size is 256k on the 32-bit system, so for 3000 users, you will need 750 MB to start 3000 threads, and before they allocate any memory to data for actual work Have done
Thread-per-user will keep a difficult limit on the number of users available, which can be artificially low, which the server can handle with a different design. Per thread can be slightly better in this area, but it can also limit the number of fields.
The important function in a large number of yarn is the switching overhead. To avoid this, I try to remove the "ownership" of the thread from the design and instead use a work pool, such as someone The game processing is divided into units of work, which you deposit in the pool. Usually the pool is set to set the same threads as the core, so that you get the most efficient performance. (If the threads are I / O bound, then you can use more thread than the coat.)
Comments
Post a Comment