I would like to avoid bottlenecks in a b4j server for a multiplayer game.
I have read this Erel's statement:
I thought of creating a thread for each game room (instance of a class clsGameRoom).
All objects and rules inherent to a room in this class.
Objects of type clsPlayer containing references to WebSocketHandler objects (these also run in their own thread).
Vaguely, something like:
Is the above "method" right (and necessary) or can I avoid to use the Threading library?
Am I wrong or if I use a single module to handle all game rooms (in the Main thread) I would end up in that bottleneck?
Many thanks.
I have read this Erel's statement:
In most cases it is a mistake to use the Threading library
I thought of creating a thread for each game room (instance of a class clsGameRoom).
All objects and rules inherent to a room in this class.
Objects of type clsPlayer containing references to WebSocketHandler objects (these also run in their own thread).
Vaguely, something like:
Is the above "method" right (and necessary) or can I avoid to use the Threading library?
Am I wrong or if I use a single module to handle all game rooms (in the Main thread) I would end up in that bottleneck?
Many thanks.
Last edited: