Comments (2)
I think this issue makes the library hard to use in a multithreaded environment. The documentation for lmdb says of mdb_dbi_open
, "After a successful commit the handle will reside in the shared environment, and may be used by other transactions." It also says, "This function must not be called from multiple concurrent transactions in the same process."
Together, I take it to mean that the main process should open a database once (inside a transaction) and then pass the dbi handle to each of the threads it spawns. Without being able to copy an lmdb::dbi
, I think the only way to do this is to pass the underlying handle around.
from lmdbxx.
In my fork of this library (https://github.com/hoytech/lmdbxx) I have made lmdb::dbi
instances copyable. I can't think of any situation where copying the dbi would cause a bug, and in many cases being able to copy dbis or pass them by value simplifies application code.
from lmdbxx.
Related Issues (19)
- How to get an specific value with lmdb++ HOT 3
- Feature Request: remove dependency on pthreads? HOT 4
- How can I save '0' ? HOT 2
- Symbol mdb_env_create() doesn't resolve HOT 1
- No updating value when key exists HOT 1
- Example uses the same dbi instance with a different transaction HOT 2
- Could you tag a new release? HOT 1
- Cursor double free on write tx HOT 1
- I forked this repo for C++17
- mdb_del : Invalid argument for simple deletion HOT 9
- Cursor.get returns key and value concatenated into key variable HOT 10
- Double-free when txn.commit() throws
- Merge into lmdb HOT 5
- Help needed cursor_put and MDB_MULTIPLE HOT 5
- problem in lmdb++.h line 1654 HOT 1
- Querying for different types in key/value pair HOT 1
- thread-local storage is not supported for clang7 HOT 1
- Enhance error messages in exceptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lmdbxx.