Hello everyone. I'm currently using IOCP with threads to handle both networking and message processing. Since I do not have a fixed main loop I'm creating a thread whenever I need some system updated periodically.
Due to that, I'm using locks to synchronize entirety of the shared data(which is the majority of the data since it's a game server). Though, I've been told, this could result in a slower overall performance than a single threaded application and a higher chance of ending up with deadlocks.
I would like to get rid of majority of these locks by changing my message processing and game updating design. I'm not experienced enough to know possible message processing/game loop designs which lead me to creating this kind of awful system in the first place. That is why I would very much appreciate if someone could explain me how it's done in industry.
Tasks which the server is responsible with(Pretty much what any MMORPG server would need to do):
- Keeping track of players surroundings and updating them properly(Currently using a fixed node system and a thread for updating.)
- Handling user specific data(Such as items, skills, etc.)
- Combat systems(Casting skills, normal attacks, etc.)
- Handling global data(Guilds, auction, etc.)
- Other small/big systems such as trading, party, other MMORPG elements.