C&C and Event Rescheduling

Shawn Halpenny malachai at iname.com
Fri Jul 11 17:04:06 New Zealand Standard Time 1997

I've been toiling with a lockless database model that (from what I've
seen on here) is similar to JCL's.  I would repost the definitive
articles but I don't seem to have them kicking around (is it possible to
automatically get an archive?).

1.  A client requests object O from the database. 
2.  Return OC (a client-only copy of O) to the client. 
3.  The client returns OC' after some munging. 
4.  If no changes have been made to O since the request was made
    (a different client request may have committed changes to O
    while OC' was being created), OC' is atomically committed to
    the database and notification of success is returned to the
5.  If O has changed, OC' is thrown away and the client receives
    notification that OC' could not commit.

An event is the client and if it finds out OC' couldn't commit, the
event is immediately rescheduled.

Now assume we have event A and B trying to commit object O.  A and B
first occur at the same time.  Event A's changes to O take twice as long
as B's changes to O, so B commits first, causing A to reschedule.

Say that the system is generating event B's like a mad bastard. It seems
to me that in some cases, it would be possible (though unlikely) that
event A will never be able to commit its changes, since the continuous
committing of event B's changes prevents A from ever finishing.

Is that possible?  And if so, what's an elegant solution?  (Timed delay
on B's next attempt at committing?  Block B until A commits?  Reschedule
A with higher priority?)

Shawn Halpenny

"At any given time there is a 50% chance I've become discontinuous
 on the probability axis."
                                            - Me

More information about the MUD-Dev mailing list