Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Write access needs to be protected #1

Open
RussellHaley opened this issue Oct 7, 2017 · 0 comments
Open

DB Write access needs to be protected #1

RussellHaley opened this issue Oct 7, 2017 · 0 comments

Comments

@RussellHaley
Copy link
Owner

Issue
lmdb allows only one writer per environment.
http://www.lmdb.tech/doc/starting.html
"There can be multiple simultaneously active read-only transactions but only one that can write. Once a single read-write transaction is opened, all further attempts to begin one will block until the first one is committed or aborted. This has no effect on read-only transactions, however, and they may continue to be opened at any time."

I am unsure of how lua's single threading affects this limitation, but can conceive that yielding will be problematic. Should the system support multithreading with one environment?

Solution
There needs to be a new write transaction manager created that mutexes the write access and stores it in the lmdb environment wrapper (?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant