[424] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: fork()/suspend(0)

daemon@ATHENA.MIT.EDU (Wed Sep 21 02:56:23 1994 )

From: stewarta@netcom.com (Alex Stewart)
To: deforest@netcom.com (Robert de Forest)
Date: Tue, 20 Sep 1994 23:49:51 -0700 (PDT)
Cc: coldstuff@MIT.EDU
In-Reply-To: <199409210542.WAA00434@netcom17.netcom.com> from "Robert de Forest" at Sep 20, 94 10:42:59 pm

> 0.12's pause() resumes whenver all input has been handled, not at the next
>  heartbeat.

oops.. I hadn't looked closely enough at the code (I didn't realize there was a
different builtin for pausing in this manner than for suspend/resume.  I had
basically assumed that a pause was handled by suspending the task and then
resume()ing it when its time came up as part of the heartbeat handler (thus
allowing pausing for a specified number of seconds, but not allowing a 0-second
pause).  I just saw all the other pausing stuff in there a few minutes
ago.. sigh).  Actually, now that I look at things, doing things way I just said
with the callback mod seems more flexible anyway (and removes a bit of code and
complexity from the server too)..  perhaps it would be better to replace
pause() with the callback system and enhance the server while simplifying its
internals a bit?

> I still see no need for creation of new tasks. At least, I don't see a reason
>  why waiting for the next heartbeat is a problem. If it can be explained to me
>  why one second is too long to wait then Riche's solution seems amicable.

Well, I can remember one situation (the lemming) where it would have been nice
to be able to do this, and I suspect I could come up with other scenarios if I
thought about it (and more importantly that they will probably come up on their
own as people use ColdMUD for more and varied things.  Things like this never
do sweep under the rug very well in my experience), but then again, it's a
simple change that adds functionality without restricting anything or really
bulking up the server..

Is Jordan around/on the list at the moment?  If so, Jordan, what do you think
about my callback system vs pause(), as mentioned above?

As it is, I rather like my callback system, but if nobody wants it I can let it


PS:  Just found a bug in the pause() code, BTW.. if the heartbeat is turned
off, paused tasks won't resume either (until some IO takes place).

Might want to move the 'seconds = (paused ? 0 : seconds);' outside the if/else
block in main.c..
   Alex Stewart - stewarta@netcom.com - Richelieu @ Diversity University MOO