Lightning Memory-Mapped Database: Difference between revisions

Content deleted Content added
No edit summary
citation needed for the Concurrency section
Line 44:
 
=== Concurrency ===
LMDB employs [[multiversion concurrency control]] (MVCC) and allows multiple threads within multiple processes to coordinate simultaneous access to a database. Readers scale linearly by design. While write transactions are globally serialized via a [[mutex]], read-only transactions operate in parallel, including in the presence of a write transaction, and are entirely [[wait free]] except for the first read-only transaction on a thread. Each thread reading from a database gains ownership of an element in a shared memory array, which it may update to indicate when it is within a transaction. Writers scan the array to determine the oldest database version the transaction must preserve, without requiring direct synchronization with active readers.{{cn|reason=whole section has no references, anomalous for the page as a whole}}
 
== Performance ==