Re: Circlemud design issues

From: George (greerga@CIRCLEMUD.ORG)
Date: 04/21/98

On Tue, 21 Apr 1998, James Turner wrote:

>The archetecture is too complicated for that.  You can't just define
>out the thread creation calls.  Too much other code needs changed.
>And there is still the issue of the need to use quite a bit of mutex
>locking -- which effectively serializes the code.

No, code like the creation would remain in a separate function but all the
locking functions could be eliminated.

>Unless you keep me from issuing a command more than X times per second
>there will be.  Someone local could blast 500 "n" commands to the mud
>and be there as fast as their link will take them.  It just adds to

You can type just as fast on a slow link, your commands just get 'clumped'

>into account).  Further, someone could monopolize resources by
>spamming high CPU use functions, and it wouldn't be immediately clear
>from the cause.

It's not hard to delay, or limit the commands if deemed necessary for
that purpose, many MUD's I have seen check for spamming commands.  But
delay isn't necessarily needed for link conditions.

>> >There's no check to see if ch's str is valid, or if ch is a valid
>> >pointer, etc etc etc.  Macros are bad.
>> ch->id = 1;
>> There's no check to see if ch is valid or 1 can be assigned to it.
>> C assignment statements are bad.
>You're being asinine.  If you wish to have a discussion without
>knee-jerk reactions, then let's do so.  If you wish to be insulting,

I'm taking your argument to the extreme to show its absurdity.  I
apologize that you thought I was insulting you.

>If speed isn't the issue, what exactly is your objection to redundance
>when it could avoid corruption and crashes?

There's no point in checking if a variable is within limits three times,
irregardless of speed issues.

#define LIMIT(var, min, max)    (MAX(min, MIN(var, max)))

GET_STR(ch) = LIMIT(new_strength, 3, 18);

Simple, within limits, and easily circumvented if you don't need the check.
You don't need to check once in the function, and another time when the
assignment function executes.  The argument for limits doesn't apply for
strings, where everything should check for a NULL pointer.  Your careful
checking may be destroyed by a memory overrun anyway, in which case your
check upon assignment won't help there.

George Greer  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST