[DGD] time() and suspending call_outs

Steve Wooster swooster at xprt.net
Sun Apr 25 00:34:16 CEST 2004


     My first question is... are time() and militime() static within a 
single thread? For example, would this be an infinite loop or a one-second 
loop?

void hog_all_the_cpu()
{
     int time=time();
     rimits (-1,-1)
     {
         while(time==time());
     }
}

What about if I replaced time() with militime() in that function?

I just thought of another question... I might have already asked this, but 
I can't remember... is there a way to decrease the number of ticks 
remaining permanently? For example:

void my_func()
{
     // 100 ticks remaining
     rlimits (-1,50)
     {
         // 50 ticks remaining
         my_func2();
         // about 30 ticks remaining
     }
     // 100 ticks remaining
}

void my_func2()
{
     // about 50 ticks remaining
     use_up_ticks_without_using_cpu(20);
     // about 30 ticks remaining
}

Is there any way to do the use_up_ticks_without_using_cpu() function?

And finally, the original reason I wrote this mail: When I was looking at 
the kernel lib, the impression I got from the call_out functions in the 
auto object, was that when the kernel suspended call_outs, it didn't pause 
them, but rather delayed them until just after the call_outs were released. 
Is this correct? I'm kind of worried that this could end up getting players 
killed on a hack-n-slash mud. Imagine that there's a huge pause for 30 
seconds while the mud does something CPU intensive, then suddenly all the 
combat occurs at once and you're dead without a chance to flee.

I just thought of one more question... for an object daemon, since I don't 
want the source code of every single object stored in memory at once, am I 
forced to store the source code in real objects rather than LWOs referenced 
by the object daemon?

Thanks for any replies!

-Steve Wooster

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list