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 111 forks source link

Windows's SRW-lock should be replaced by a custom recursive untied-to-thread lock. #210

Open erthink opened 3 years ago

erthink commented 3 years ago

Windows is unable to extend or shrink mapped region without closing/unmap it. Theresofre, on Windows a SRW-lock is used to protect threads with a read transaction from accessing a temporary unmapped region during it shrink or expand. However, with MDBX_NOTLS option transactions could be used from other threads and the same thread could start more than one read transaction. Currently, to prevent this, libmdbx does not shrink a DB file and does not increase the mapping size when using the MDBX_NOTLS option.

So SRW-lock should be replaced by a custom recursive untied-to-thread lock.

erthink commented 3 years ago

In continue to #203, pre-requirement for #200.