[DGD] atomic functions

Felix A. Croes felix at dworkin.nl
Mon Nov 17 19:02:31 CET 1997


I mean to introduce a new function class specifier, 'atomic'.

An atomic function succeeds or fails as a whole.  If an error occurs in
an atomic function (or in code called from there), and the error is not
caught inside the function, the state of everything is returned to what
it was before the function was called (except that there is still the
error to deal with, and the amount of remaining ticks will have been
decreased).  Thus, by making a function atomic, you can ensure that
things are not left in an inconsistant state.  It will be impossible to
make changes to files from atomically executed code.

Another option is to use rlimits (-1; -1) for this purpose, but that
should only be used from privileged code, and it only deals with stack
and tick limits and not with other possible causes for errors.

Comments?

Dworkin



More information about the DGD mailing list