1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 17:19:31 +00:00

Proper checkpointing of mutable values

This commit is contained in:
Étienne Fildadut 2021-12-06 18:34:58 +01:00
parent 801df67461
commit 04c6683de8
14 changed files with 243 additions and 23 deletions

View file

@ -49,6 +49,8 @@ $ parallel
parallel: {main.var}
~ main
(note: if two scripts try to modify the same value at the same time, one of them will win, but which one is undefined/a surprise)
```
The purpose of this system is both to allow several scripts to run at the same time with an easy way to avoid interferences, and to make sure the global state is always in a consistent (and not in the middle of a calculation): since scripts can be interrupted at any time, when it is interrupted, anything that was changed between the last checkpoint and the interruption will be discarded. If you're a RDBMS person, that's more-or-less equivalent to a transaction with a repeatable read isolation level (without any sort of locking or lost update protection though).