I'm trying to create a multiplayer game and I'm wondering if it will be useful to use threads and also how to use them.
There would be the following actions in the game (on linux server):
1) server checking if clients are still connected
2) collision detection
3) processing players' input
4) sending the result data to clients
5) ... and probably many more
My questions are:
1) How many threads can be created? (I know that if there is too many, they have to wait for their turn, but is there a limit?)
2) Lets say I would create a new thread for each player (let's say 1000 or more). I suppose it makes no sense, but would than the switching between threads be very time consuming?