mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 10:58:21 +08:00
mdbx: more info about "one threat - one transaction".
Change-Id: I070750b081e02113577dac13488d01f9d18e759b
This commit is contained in:
parent
49d9779c84
commit
01f65bc872
16
mdbx.h
16
mdbx.h
@ -201,6 +201,14 @@
|
|||||||
* necessary) in a child process would be both extreme complicated and so
|
* necessary) in a child process would be both extreme complicated and so
|
||||||
* fragile.
|
* fragile.
|
||||||
*
|
*
|
||||||
|
* Do not start more than one transaction for a one thread. If you think about
|
||||||
|
* this, it's really strange to do something with two data snapshots at once,
|
||||||
|
* which may be different. MDBX checks and preventing this by returning
|
||||||
|
* corresponding error code (MDBX_TXN_OVERLAPPING, MDBX_BAD_RSLOT, MDBX_BUSY)
|
||||||
|
* unless you using MDBX_NOTLS option on the environment. Nonetheless, with the
|
||||||
|
* MDBX_NOTLS option, you must know exactly what you are doing, otherwise you
|
||||||
|
* will get deadlocks or reading an alien data.
|
||||||
|
*
|
||||||
* Also note that a transaction is tied to one thread by default using Thread
|
* Also note that a transaction is tied to one thread by default using Thread
|
||||||
* Local Storage. If you want to pass read-only transactions across threads,
|
* Local Storage. If you want to pass read-only transactions across threads,
|
||||||
* you can use the MDBX_NOTLS option on the environment. Nevertheless, a write
|
* you can use the MDBX_NOTLS option on the environment. Nevertheless, a write
|
||||||
@ -383,6 +391,14 @@
|
|||||||
* belongs to one thread. The MDBX_NOTLS flag changes this for read-only
|
* belongs to one thread. The MDBX_NOTLS flag changes this for read-only
|
||||||
* transactions. See below.
|
* transactions. See below.
|
||||||
*
|
*
|
||||||
|
* Do not start more than one transaction for a one thread. If you think
|
||||||
|
* about this, it's really strange to do something with two data snapshots
|
||||||
|
* at once, which may be different. MDBX checks and preventing this by
|
||||||
|
* returning corresponding error code (MDBX_TXN_OVERLAPPING, MDBX_BAD_RSLOT,
|
||||||
|
* MDBX_BUSY) unless you using MDBX_NOTLS option on the environment.
|
||||||
|
* Nonetheless, with the MDBX_NOTLS option, you must know exactly what you
|
||||||
|
* are doing, otherwise you will get deadlocks or reading an alien data.
|
||||||
|
*
|
||||||
* - Do not have open an MDBX database twice in the same process at the same
|
* - Do not have open an MDBX database twice in the same process at the same
|
||||||
* time. By default MDBX prevent this in most cases by tracking databases
|
* time. By default MDBX prevent this in most cases by tracking databases
|
||||||
* opening and return MDBX_BUSY if anyone LCK-file is already open.
|
* opening and return MDBX_BUSY if anyone LCK-file is already open.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user