[MUD-Dev] C&C and Event Rescheduling

Miroslav Silovic silovic at srce.hr
Sat Jul 26 19:42:15 New Zealand Standard Time 1997


> GJon A. Lambert wrote:
> > 
> > > From: clawrenc at cup.hp.com
> > > Subject: [MUD-Dev]  C&C and Event Rescheduling
> > >
> > >   Re: #5.  How do you determine that the object has changed during the
> > > execution of the event?  I do this by always keeping an original copy
> > > of the object to compare to the copy current in the DB and then do a
> > > bit-wise comparison of the two objects.  The original copy is the
> > > second copy made above for a modification.

I already specced the commit procedure for Cold, however, I went for
locking instead of copying. When you read an object, you obtain a read
lock on it. On write, the original is copied (in case of the rollback),
however, if any other task has a read lock on the object, writer gets
a rollback. If write suceeds, the object gets a write lock - attempt
to read a write-locked object causes rollback (these are the basic
rules, of course). Temporary copies are kept in a hash table (hashed
by object IDs), and thrown away on commit (along with write locks).
Advantage of this method is that things are not copied unnecessarily
(actually piling the copy in the hashtable is a simple reference
tweaking, and not actual tree-copying). 'Object' here actually means
object attribute, object method, object header (i.e. objname and
parents/children lists), file buffers and networking buffers.
Of course, none of this has been implemented yet. :)

	Miro





More information about the MUD-Dev mailing list