[DGD] Hope someone can help

Erwin Harte harte at xs4all.nl
Fri Sep 14 05:10:31 CEST 2001


On Fri, Sep 14, 2001 at 03:06:22AM +0100, mtaylor wrote:
[...]
> > 
> > To be honest, since you have full control of all the code, you can
> > probably just stick a bunch of rlimits in the right places and do
> > something about callouts.
> 
> The thing is ... I don't know what ticks and stacks are. I know that
> probably makes me seem like a four year old running for president ;)
> We are not going to run the standard code/builders thing. We want to have a
> test mud where we can fully test new code as it comes along. Code will be
> submitted by other coders and not written from within the mud.

The 'stacks' refers to one function calling another, which calls
another, etc.  If your 'stack' of functions calling eachother gets too
deep for the current rlimits settings, DGD will abort it.  This will
not be a problem unless you're doing some interesting recursive
functions, be they intentional or not.

The 'ticks' refer to the fact that everything you do in LPC will be
assigned with a 'cost in #ticks', with a minimum cost of 1, more
complicated operations such as certain array or mapping operations
would cost more depending on the size of array/mapping they're working
with, etc.

This way, if some code ends up going in circles without getting
anywhere, DGD can at some point say "All good and fun, but you've used
up all the ticks you've been given, now let someone else play". ;-)

> To be honest with you ... I didn't understand any of the bit about Callout
> Gateways and the like ... Sorry Par :(

I think he is referring to what I describe a few paragraphs further in
my reply here.  What, you reply to messages by beginning at the top?!

> I also wondered what you mean by putting a bunch of r-limits in the 'right
> places' ... Um ... Where would the right places be? Any advice on where to
> put r-limits. And how do I do that?

The right places would be 'anywhere that you could start a new thread'
in other words anywhere that DGD calls functions into objects.

Examples:
- receive_message()
- open() & close()
- the functions called from a call_out().

> Also what is it I need to do about call-outs? Is it preventing call-out's
> being made when their aren't enough stack/tick thingies which I suppose
> would be bad for the mud running?

You want to overrule the original call_out() kfun and replace it by
one that calls a helper function that calls the _intended_ function
inside a 'rlimits (..; ..) { .. }' block.

> Last question on that ... Does it matter if we didn't include r-limits any
> where? Is it something that will prevent our mud from working?

It could, if someone got it into their head to write a piece of code
that effectively did this:

  while (1) {
     ...
  }

because, with no ticks-restrictions, it would never be aborted by DGD,
so nothing else could happen anymore!

Heop this helps,

Erwin.
-- 
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list