[MUD-Dev] Re: MUD Development Digest

Jon A. Lambert jlsysinc at ix.netcom.com
Wed Apr 22 18:26:27 New Zealand Standard Time 1998

On 10 Apr 98 at 11:51, Chris Gray wrote:
> [Alex O:]
> [Fibre description snipped]
> :I don't any advantage in using fibers instead of threads in a MUD server.
> I'll second that. Fibres within a thread cannot take advantage of extra
> CPU's, so give you no speed increase on multi-CPU machines. If a fibre
> does a system call, the entire thread is busy until that call returns.
> So, unless you have some flow-control problem that is best solved by
> having the multiple contexts of multiple fibres, and you need to switch
> those contexts so often that threads are too expensive, there is little
> gain to using fibres.

After coming up to speed on the matter, I'll third it. ;)
Some theoretical caveats though.  In applications where multi-tasking 
has already designed into the software through soft-control, fibers 
may well be have an advantage over the expense of using threads.  
Some soft-control thread implementations perform better than 
hard-control or OS thread-switching.
     The decision whether to use them are similar to deciding 
whether to have the OS do memory management or cacheing for you.  
Once again the application may well know better than the OS on how to 
schedule it's tasks.  Still your are limited to the priorities 
established by the running process or controlling thread.
     I don't see my server benifitting from fibers in any 
"measurable" way, since my implementation of threads is primarily in 
points of control where asychronous execution has performance 
benefits (I/O).  However they might provide a slight performance 
boost in the simulated concurrency of multiple executing VMs which 
currently are thread-based although they are really time-sliced (or 
tick-based) not premptive.  Fibers might be superior to threads in 
time-sliced applications which have no synchronous waits.  Then 
again, this would not be true should I ever get run it on a machine 
capable of multi-processor threading.   

--/*\ 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   /*\--

MUD-Dev: Advancing an unrealised future.

More information about the MUD-Dev mailing list