[MUD-Dev] Atomic functions

Christopher Allen ChristopherA at skotos.net
Tue Nov 14 17:53:01 CET 2000


Ben wrote:
> Would it not be easier to check for the requirements first?
...(examples deleted)
> in this way, you save coding time, and also make it more
> efficient, no more
> extra threads, or extra functions, just call the destination with the
> object, instead of the object with the destination.

For a relatively simple piece of code it is true that checking requirements
first is faster. Using atomic functions for many functions will definitely
slow things down.

However, with more complex routines, with many levels of nesting, the
requirements check might be valid when checked, but by the time the routine
got to the values themselves, are not valid anymore.

Even this could be caught by good coding, however, the real value of atomic
functions is not in a single-processor environment. The work that Felix has
been doing in DGD is leading toward being able to code as if you were in a
single threaded environment, however, if some other processor pulls the rug
out from underneath your code, it will just rewind and start over. Thus the
true value of atomic functions is that they enable multiprocessing.

-- Christopher Allen

------------------------------------------------------------------------
.. Christopher Allen                                 Skotos Tech Inc. ..
..                           1512 Walnut St., Berkeley, CA 94709-1513 ..
.. <http://www.Skotos.net>               o510/647-2760  f510/647-2761 ..




_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list