Setting the number of threads in thread pool of server

At the startup of server(Proud.CNetServer.Start,), you can assign the number of threads of Thread pool.

The role and function of server varies upon how many server processes are running and how many threads are created in the server computer.

Here are the typical guides.

  • First, let's assume the number of threads is equal to the number of CPUs in server.
  • If the server that uses ProudNet takes device burst time instead of CPU burst time ten it will increase the number of thread. (Refer to Understanding burst time) The case where game server most typically takes device burst time is when it accesses user database.
  • If the logic of game server is structured in simultaneous accessing from multi-threads, it is ok to let the server computer run just one of game server processes. But if it is protected by critical section or mutex to run from single thread, then it is wise to launch up several game server processes.