emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mutating existing persistent data (was: sqlite3)


From: Stefan Monnier
Subject: Mutating existing persistent data (was: sqlite3)
Date: Mon, 06 Dec 2021 09:09:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> 1. A persistent hash table can be declared as :value-mutable t.
>>   In such case it will make an internal copy of its values ...
>> 
>> 2. A very radical approach (I consider it probably the “right” way).
>>    Add a cell-mutated-hook to Emacs Lisp VM …
>
> 3. Provide a function (SYNC-DATUM DATUM STORE),
>     and rely on user/package author to call it everytime
>     some datum which is also a part of a persistent store
>     is mutated.
>     This is probably the most flexible solution, with minimal
>     overhead, by shifting more responsibility to package authors.

I don't think it includes enough information for the persistent data to
be updated correctly in the presence of concurrent updates.

You either need the application to provide some atomicity/transaction
boundary information, or you need the application to send changes as
changes rather than as the resulting state (i.e. send "increment x by 2"
rather than "x is now 23").


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]