[MUD-Dev] World Persistence, flat files v/s DB v/s ??

Vadim Tkachenko vt at freehold.crocodile.org
Tue Mar 24 19:12:24 CET 1998


Matt Chatterley wrote:
> 
> On Sun, 22 Mar 1998, Vadim Tkachenko wrote:
> > Joel Dillon wrote:
> > > On Sat, 21 Mar 1998, Ben Greear wrote:
> > >
> > > >
[skipped]

> A valid notion. My mud is being set up so that rather than the (standard
> for LPmuds as far as I know) system of rebooting once per period of time
> (usually 24-48 hours), it will reboot at any time within a period of 6
> hours when there are no user connections open to the server.
> 
> Obvious advantage: Players are never inconvenienced by reboots.
> 
> Obvious disadvantage: What if there is never such a gap? Well,
> statistically speaking, if it checks every 6 hours, it'll check 28 times a
> week (and these times will reflect the period at which it last rebooted,
> so it will hit the same time again). Should it go a period of y days with
> no reboot, it will reduce the frequency of checks. At some time, the mud
> will be empty. :P

I've implemented a different approach in the Jukebox: there is an idle
tracker service, and every time you start to process something or end to
process something, you reset your time count on that service, so you'd
be notified if there was a delay after LAST action. This way, you don't
have to wait 6 hours.

Funny, the implementation is amazingly simple: there is a concept of the
semaphore which throws the exception unless posted, and all the idle
handling is right here:

while ( isEnabled() )
{
 try
 {
  idleSem.waitFor( timeout );
  // do nothing here, I'm not interested in posts
 }
 catch ( SemaphoreTimedOutException ex )
 {
  report_timeout();
 }
}

>         -Matt Chatterley

--
Still alive and smile stays on,
Vadim Tkachenko <vt at freehold.crocodile.org>
--
UNIX _is_ user friendly, he's just very picky about who his friends are



More information about the mud-dev-archive mailing list