On Thu, 24 Nov 2016 22:59:32 +0100
Florian Weimer <fwei...@redhat.com> wrote:

> Does LMDB perform lock-free optimistic reads and 
> retroactively verifies that the entire read operation was consistent? 

In LMDB there are readers and reader-writers.  A reader never writes; a
reader-writer may read, but that read counts as a "write" for purposes
of isolation.  

Each actor -- reader or reader-writer -- is isolated from all others.
There are no write-after-read errors or other SQL isolation anomalies
because there is only ever at most 1 transaction in existence capable
of writing.  Any call to begin a second writable transaction blocks
until the first one completes.  

LMDB uses MVCC to provide each reader with a database snapshot.  If a
writer modifies a row that a reader sees, that modification
happens "elsewhere" to a version that the writer sees and the reader
does not.  After the writer commits and no transactions remain
that refer to the superseded version, it ceases to exist.  New readers
thenceforward see the modified version.  

--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to