Closed lquenti closed 2 months ago
Hi, I just looked at the benchmark test, perhaps it can help you further: https://github.com/cberner/redb/blob/master/benches/lmdb_benchmark.rs#L224
This file is a good example of concurrent writing: https://github.com/cberner/redb/blob/master/benches%2Fmultithreaded_insert_benchmark.rs
You can't open a database file twice, but concurrent access to the Database and Transaction objects should be safe. As long as it compiles it should be correct 😊
Hi,
could you add an example for multithreaded use? Especially because of this in the README:
This confuses me with the definition of the struct:
Having an
Arc
and "concurrent readers" reads to me like I can just clone it to other threads/routes, but it does not implement clone!Arc<Mutex<Database>>
or isArc<Database>
enough?Database::open
on the same file twice?