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.
The text was updated successfully, but these errors were encountered:
erthink commentedJun 18, 2021
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.
The text was updated successfully, but these errors were encountered: