[DGD]atomic

Felix A. Croes felix at dworkin.nl
Wed Jun 16 16:58:26 CEST 1999


I mean to implement atomic functions within the next few months.
Since they have some implications on mudlib design, let me detail
in advance what they do:

An error in an atomic function will undo all the changes made
within the function.  This is also true for code called from an
atomic function.

Changes will only be undone when an error forces execution to
leave the atomic function; an error caught within an atomic function
will not be undone.  If an error is caught in code that called the
atomic function, changes will be undone before the error is caught.

It is an error to move, remove, or write to a file within atomically
executed code.

Calls to atomic functions may be nested.

Atomically executed code uses up twice as many ticks as the code
that called the atomic function.

Example:

    atomic void move(object destination)
    {
        environment = destination;
        destination->enter(this_object());
    }

An error in move(), or within enter() in the destination, will
undo the movement before propagating the error.

The "atomic" function class can already be used in code, but it
doesn't do anything yet.

Regards,
Dworkin

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



More information about the DGD mailing list