Re: [CODE]..

From: Chris Gilbert (
Date: 06/19/00

Mysidia wrote:
> On Sun, 18 Jun 2000, Del wrote:
> > One simple way of fixing this problem.
> > When it asks if you want to save internally, I make a call to the
> > appropriate
> > save_to_disk function.
> > This way everything is saved when you select yes.
> > I never did see a purpose in saving internally, and not to disk.
> >
> > It might even be better to insert another question:
> > Do you wish to save to disk? (Y/n)
> > make the call on default and yes.
>    Let's see.. you have optimizations.. saving to disk does take a sum
> of cpu time -- opening and writing to a file is an expensive operation
> and can take significant system processing time during which the entire
> mud must wait for the physical save's completion -- an update to
> the internal status is quick; though sometimes buggy

As this all started from an OS class I'd have thought that someone would
point out that the above is just wrong in a modern OS.  A modern OS
stores a lot of the info on the disks in memory, and uses a buffer to do
read and writes to.  This is why you have to shut them down properly.
IE when you open the file it does do a bit of disk activity, but is more
likely to delay the write by buffering it until it's got a bit of free
CPU time to do the write.  Hence the need to sync disks during shutdown.

I'm not sure how old the olc code is, but circlemud is 5-6 years old,
that long ago memory wasn't cheap, processes weren't as fast, in that
time we've come from 486's to PIII's, a std computer now comes with 64MB
not 4MB.  In those days doing disk writes was expensive as you couldn't
buffer as much in memory, that's why the save internal is probably
there, to act as a buffer.

>    'saving internally' simply means updating the online status; there is
> such a thing as making a temporary change to something and not
> wanting the change to be a permanent one -- once you save to disk, the
> change is committed meaning 'no matter how bad' it is you can only
> revert if you have a backup.

Oasis 2 actually does a save of everything on a shutdown, so eventually
all changes in memory get written out.

>     And being a little buggy means you -definitely- shouldn't save after
> every edit, and you should prolly backup and diff the changes between saved
> and pre-save copy just to be safe.

Oddly enough most builders I know save after virtually every edit as OLC
is generally considered fairly unstable, hence a lot of muds have
builders ports. It's improved a lot with Oasis 2 in terms of stability
though :)


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

This archive was generated by hypermail 2b30 : 04/10/01 PDT