Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Recursive use of SRW-lock on Windows cause by MDBX_NOTLS option. #203

Closed
erthink opened this issue Jun 9, 2021 · 1 comment
Closed

Recursive use of SRW-lock on Windows cause by MDBX_NOTLS option. #203

erthink opened this issue Jun 9, 2021 · 1 comment

Comments

@erthink
Copy link
Owner

erthink commented Jun 9, 2021

Windows is unable to extend or shrink mapped region without closing/unmap it.
So in 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.
Thus this causes recursive acquiring the same SRW-lock by the same thread.

This should be fixed, or at least documented:

  1. don't resize a database on Windows when using MDBX_NOTLS.
  2. or replace native SRW-lock by a custom recursive untied-to-thread mutex.
@erthink
Copy link
Owner Author

erthink commented Jun 11, 2021

@vorot93, по-возможности проверьте это исправление в вашей "акуле".

Здесь проблема устранена ценой определенных ограничений (см. комментарий в самом коммите), т.е. это "костыль".
Тем не менее, именно это исправление пойдет в master и затем в ближайший минорный релиз.

А уже после этого я намерен:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant