[DGD] rlimits

Steve Wooster swooster at xprt.net
Mon Mar 29 08:21:51 CEST 2004


     I'm a little confused about exactly how rlimits works... I understand 
that you put it around code to limit how many tick/etc that code can take 
up, but I'm confused as to how rlimits within rlimits works...

For example: (I've forgotten whether ticks or recursion depth comes first, 
so I'll say "ticks" or "depth" after the numbers)

void func()
{
     rlimits (10 depth, 100 ticks)
     {
         code that uses 50 ticks;
         rlimits (10 depth, -1 ticks)
         {
             code that uses 25 ticks;
         }
         // Are there 50 ticks remaining or only 25?
     }
}

Now that I've typed this out, I think I know what I want to ask... When you 
use an rlimits construct inside another one, does code inside the inner 
rlimits it count towards the ticks for the outer rlimits? It seems like the 
most logical answer would be "no", but I'd feel better if somebody 
confirmed this.

If the answer is "no", is it possible to make it so that the code inside 
the inner rlimits construct uses up a certain amount of ticks for the outer 
construct? Like, in the example above, what if I wanted the code that used 
up 25 ticks to count towards the outer rlimits?

If the answer is "yes", is it possible to make a function that doesn't use 
any ticks at all, even when called from within something like rlimits 
(100,100)?

Thanks for any help. I did look through the "last bastion" archives a 
little, but didn't see anything that answered this question.

-Steve Wooster

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



More information about the DGD mailing list