[MUD-Dev] Re: async i/o and threads (was: Re: lurker emerges

Jon A. Lambert jlsysinc at ix.netcom.com
Mon Aug 10 23:56:18 CEST 1998


On 10 Aug 98, James Wilson wrote:
> Thanks for the reference. I read it a couple of days ago when I was poking
> through the archive, but it's more useful to me now after the recent
> discussions.
> Portability question: does the select() available with the mingw32 system
> (which
> might come straight out of winsock, I don't know) have any gotchas? I can
> get about 20-30 connections accepted per second, with the client on the
> local
> machine; that seems plenty fast to me.
> 

What is the mingw32 system?

> The reason I'm paranoid about the amount of time spent in processing is user
> scripts; I'm sure I can't trust people not to write inefficient or
> infinite-looping code,
> and it'd sure be nice to have the latter locked away in a thread so they
> don't
> prevent others from logging in (or me from killing the runaway). I'm not
> sure how
> this could be accomplished cleanly in a single thread. Also, if one uses a
> disk-based
> system, 'zone faults' would seem to be a great thing to put in a thread
> separate
> from the socket i/o thread.
> 
> I'm a bit concerned about the overhead of using a thread pool, though, since
> my two
> target platforms (win32 and linux) use heavyweight threads. Has anyone tried
> a bytecode vm that implements user-level threads, setting up a scheduler
> that timeslices between 'processes', switches context on blocking i/o, and
> so on? Maybe this could give you lightweight, portable threading while
> keeping the whole process in a single thread? I'm imagining something where
> the main thread is either chomping bytecode or checking for io-ready
> sockets.
> 

Aye .  I believe MUQ does exactly this.  Many of the programable 
servers impose execution limits on internal tasks (i.e. Cold, LP) 

--
--/*\ Jon A. Lambert - TychoMUD     Internet:jlsysinc at ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\   "Everything that deceives may be said to enchant" - Plato   /*\--




More information about the mud-dev-archive mailing list