[MUD-Dev] Re: Sockets and fibers

Jo Dillon emily at thelonious.new.ox.ac.uk
Wed Jan 20 17:26:05 New Zealand Daylight Time 1999

Caliban Tiresias Darklock (caliban at darklock.com) spake thusly:
> Hopefully, this won't bounce. Once I get a message through, I'll pump
> previous messages that bounced back through here. (Not your fault, name
> server refresh problem on my end. Can't be helped.)
> Has anyone here looked at the possibilities of spawning a single thread
> which handles sockets and then using Microsoft's "fibers" to handle
> individual sockets? How much of the one-thread-per-socket problem would be
> solved by this? With the speed of modern computers, what are the real
> problems with just serialising the socket handling -- one thread with all
> the sockets, servicing each socket in turn for some small time slice?

  Correct me if I'm wrong, and I'm not an expert here, but aren't
fibers effectively cooperative threads? Isn't it likely that a blocking socket
read would block all the fibres? If not, they'd have to be real threads,
which would seem to imply you'd still get the context-switching overhead
that makes lots of threads bad news.


More information about the MUD-Dev mailing list