which I/O model for game server?
hi there, i would like to ask which I/O Model is suitable for a game server in UNIX? for 1. MMORPG? 2. provides a lots of game lobby rooms? any suggestions are highly appreciated. thanks!! pixelmana
You should probably start with the simplest possible one, and only change if there is a good reason to do so.
Obviously it will depend whether you're using tcp and/or udp, I'll assume you're using TCP or both for this discussion.
The simplest possible IO model is to use a single thread select() loop. This has proven to work well at most (small / medium) scales, and is what most servers of (non-massively) multiplayer games use.
Therefore I suggest that you start there, and once you've got a working client and server, and find that scalability is a problem (too much time spent in select and configuring your FD_SETs), look for an alternative.
Oh yes... one other thing: it's also simplest to do all local IO (disc files etc) synchronously. This is great, especially if you have enough memory to load absolutely everything in at once.
Mark
Obviously it will depend whether you're using tcp and/or udp, I'll assume you're using TCP or both for this discussion.
The simplest possible IO model is to use a single thread select() loop. This has proven to work well at most (small / medium) scales, and is what most servers of (non-massively) multiplayer games use.
Therefore I suggest that you start there, and once you've got a working client and server, and find that scalability is a problem (too much time spent in select and configuring your FD_SETs), look for an alternative.
Oh yes... one other thing: it's also simplest to do all local IO (disc files etc) synchronously. This is great, especially if you have enough memory to load absolutely everything in at once.
Mark
A more complete (but somewhat complicated for beginners) discussion about network I/O strategies for the type of project you are envisionning using a Unix system can be found here:
http://www.kegel.com/c10k.html (Clicky)
-cb
http://www.kegel.com/c10k.html (Clicky)
-cb
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement