Every client has it's own Thread. That's ok. All message handlers should be thread safe, because clients can send packets anytime, and code will handle them immediately.
But what about Room and this code?
- Code: Select all
AddTimer(tick, 50);
If I add more "AddTimer" with other functions and delays...or my tick will work more than 50ms...will other Thread tick() simultaneously? Do you have a thread pool, and is there any possibility, that my tick() will execute simultaneously by two threads?
I ask, because I want to know, whether I should make tick() thread safe or not.