In LMDB, can multiple threads simultaneously access the same database?
Asked Answered
C

0

8

I'm considering using LMDB in a web application, which, of course, will be multi-threaded.

In they Symas documentation for mdb_dbi_open it states "This function must not be called from multiple concurrent transactions. A transaction that uses this function must finish (either commit or abort) before any other transaction may use this function."

This seems to imply that multiple threads cannot simultaneously access (write to) a given database.

But the overview states "Writes are fully serialized; only one write transaction may be active at a time, which guarantees that writers can never deadlock.", which seems to imply that I don't need to worry about it.

My question is: do I need to serialize my write transactions or does LMDB take care of that for me?

Chinatown answered 19/10, 2014 at 0:52 Comment(1)
The place for questions about LMDB is openldap.org/lists/openldap-technicalFerromanganese

© 2022 - 2024 — McMap. All rights reserved.