[DGD] DGD MP and a TLS idea

Steve Wooster sw_mlists at xprt.net
Mon Apr 4 21:29:01 CEST 2005


     The current version of the kernel isn't MP optimized, right? At least 
for version 1.2.86 (I think that's the version I have) it looks like 
call_outs are registered in a central daemon... Since I'm fiddling around 
with creating a mudlib from scratch (I'm only doing it for fun, not because 
I expect to actually get far on it), I was wondering if there's a good way 
to handle things like being able to pause call_outs that isn't effectively 
single-threaded.

     Also, for thread local storage, it occurred to me that the argument 
passed could be a mapping instead of an array... then you could have things 
like: (I forgot the exact code, so this probably won't work... but it 
should give you the general idea)
Inside the auto object:

static void set_tls( mixed setting, mixed value )
{
     if (trace()[1][FIRST_ARG][this_object()] == nil)
         trace()[1][FIRST_ARG][this_object()] = ([]);
     trace()[1][FIRST_ARG] [this_object()][setting] = value;
}

static mixed query_tls( mixed setting )
{
     return( trace()[1][FIRST_ARG] [this_object()][setting] );
}

Then you could have TLS not require any authorization, because each object 
would have their own TLS. Also nobody would have to set the TLS size. I'm 
assuming this wasn't done in the kernel lib because it probably isn't 
needed, and just uses up a little extra CPU?

-Steve Wooster

PS, I haven't tested the idea on any actual TLS, but I have tested that 
setting new values on mapping references works.




More information about the DGD mailing list