erthink / libmdbx

One of the fastest embeddable key-value ACID database without WAL. libmdbx surpasses the legendary LMDB in terms of reliability, features and performance.
https://erthink.github.io/libmdbx/
Other
1.16k stars 110 forks source link

The ability to intentionally use write transactions from other (non-owner) threads. #200

Open erthink opened 3 years ago

erthink commented 3 years ago

More flexible support of asynchronous runtimes/frameworks:

  1. Add an API-flag that explicitly allows use a write transaction from other threads, not only from which transaction was started.
  2. Add an API-function that returns a boolean value indicating that the IPC method used allows the lock to be released from another thread.
  3. Enhance the logic of checking the transaction owner thread:
    • when (1) is false: full restrictions (current behaviour), i.e. always check for the transaction owner;
    • when both (1) and (2) are true: no restrictions, i.e. no checking for the transaction owner;
    • otherwise when (1) is true, but (2) is false: a get/put functions without checking, but abort/commit still with full checking, i.e. a write transaction must be completed only by the thread that started it.
erthink commented 3 years ago

Required #210.