[MUD-Dev] Atomic functions
KevinL
darius at bofh.net.au
Wed Nov 15 16:50:51 CET 2000
>>> KevinL wrote
> Oh, ok, I've just read Christopher Allen's response - atomic functions are
> just a way to say "if anything happens, kill this (and restart? Or just
> restore state?)", right? But you don't pick up things like the "another
> thread got in between check and change", you just pick up actual breakages.
> Ok, I misunderstood - I thought this was a way to do something else ;)
>
> Don't mind me, I'll get back in my box ;)
I had the whole thing explained to me by better minds than mine -
the atomic functions are a way to try and do a bunch of things at
once, and instead of suffering the overhead of checking everything
first, you can just "raise an exception" (in essence), and let the
machinery put things back as they were (in fact, things never change
until the atomic function completes successfully). It's not a
multi-thread apparatus, which is what confused me,
It's more of a performance tweak and ease-of-coding tweak. Is that
closer to the truth? It's not going to catch situations where
someone else changes things while you're running, because it's not
designed to - it's simply designed to stop you from having to
explicitly deal with failures by winding back changes yourself all
the time.
KL
KevinL
_______________________________________________
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