Learning python networking

Chris Angelico rosuav at gmail.com
Wed Jan 8 23:20:05 EST 2014


On Thu, Jan 9, 2014 at 2:49 PM, Dan Stromberg <drsalists at gmail.com> wrote:
> The third quote, from Brian Kernighan, seems to underestimate the
> complexity of asynchronous programming in the large - it's probably
> not just twice as hard.

Yeah, which is why I recommended a threaded approach to the OP. It
won't scale to millions of simultaneous connections... but he's
unlikely to have more than half a dozen in testing, and even in
production, most games aren't going to run more than a couple hundred
players. (A huge server might have more players than that
simultaneously logged in, but they'll be running different games. If
thread count becomes a problem, fork() to create a game, job done.)
Threads are easier to get your head around: this and that happen at
the same time. Sometimes it means creating lots of threads to do
similar things (one for the GUI, one for this socket, one for that
socket, one for the cron handler, etc, etc), but is that really a
problem? Probably not.

ChrisA



More information about the Python-list mailing list