select.select()

Chris Angelico rosuav at gmail.com
Sat Nov 23 02:30:46 EST 2013


On Sat, Nov 23, 2013 at 1:15 PM, Roy Smith <roy at panix.com> wrote:
> (*) I'm not sure if real MUDs are programmed this way, but it's a
> plausible architecture.  For simplicity sake, I'm assuming a
> single-threaded server.

Yeah, they certainly can. That's effectively the way that I programmed
the MUD kernel that we used at work (not for games, but it's still
effectively a MUD), although I used async I/O facilities to abstract
away the actual select calls. It's as good as the multi-threaded model
(which is what I use in Minstrel Hall - every connection spawns a
thread, which does blocking reads and blocking writes; simplifies the
code when a command wants to delay the user, as it simply sleep()s),
and can often scale to more concurrent connections, although for the
bulk of servers that's not going to be an issue.

ChrisA



More information about the Python-list mailing list