[DGD] Re: Small note plus a draft FAQ

Sampsa Ranta sampsa at netsonic.fi
Thu Dec 25 01:29:20 CET 1997



On Wed, 24 Dec 1997, Adam David wrote:

> > | Can I compile my LPC to C?
> > | --------------------------
> > | 
> > | Yes, you can.  This must be done at the time the driver is compiled though,
> > | one cannot do it on the fly.  Look in the src/lpc for more information
> > | concerning this.  The 2.4.5 mudlib simulation contains a good example of
> > | how to do this.
> > 
> >   "You can do it 'almost on the fly' though, using statedumps where  
> >    you dump state with the bytecompiled version of an object in use, 
> >    shutdown, and then boot back up with the precompiled version of that
> >    same object."
> 
> I have a working model of a package to add kfuns and precompiled objects
> as dynamically linked modules under unix. Unfortunately this is at the 95%
> stage and so needing extra work before completion for a first release, and
> I just don't have the time for it at the moment.
> 
> Theoretically I believe it possible in some cases for these modules to be
> updated on the fly, but my first shot at the code does the linking at
> program start time, necessitating a dump and restart. Anything more will
> require more work at the design phase.
> 
> As soon as I can devote some time to this again, I mean to fix it up for
> the latest stable version of DGD and release the modules package in its
> present form as version 0.1.
> 
> It could probably be adapted also to other operating systems.

I also have a solution for making "runtime" modifications to the driver,
altought my version bases on dumping and restarting the driver. I have
modificated the dump and restore code so it will be possible to dump the
connection state to disk and restore those. Sockets themselves are set to
"no close on exec"-state. If loading or executing the new driver will
fail, my code uses the ability of latest versions of DGD to reenter the 
initialize routine of existing driver. If the initialize of new or old 
driver fails, the dump file is 100% compatible with normal one, there is
just some data appended to end of it. 

This also allows one to upgrade the driver to newer version without
losing connections. If just upgrading kfuns or precompiled objects on large
systems that have big dump files and stuff like that, it takes some time
to dump/restore the mudlib and users.

Current version lacks the code to flush the buffers in any way, so all
data in incoming/outgoing buffer will be dumped on the disk. The
connection object that have lost their connection (socket) during the
driver refresh/dump/restore stage will not be notified so the restore code
at LPC has to take care of these.
 
If anyone is interested about this code, I might bring it available,
currently I have tested the code it under NetBSD and Linux.

 Note! I have wrote this to work only with the net package, not
       vanilla DGD. Altought this could be done on vanilla DGD, too.

 - Sampsa Ranta
   sampsa at netsonic.fi





List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list