You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to acquire a filelock without blocking (i.e. timeout=0). when the file is locked this operation takes 1sec (although should return immediately).
I did dome deep dive here and figured out that the reason is msvcrt.locking function (which implemented using _locking - even in a pure C++ project it takes 1sec to try acquire already locked file using _locking.
Using winapi LockFile doesn't have this problem - it returns immediately when the file is already locked .
Do you think it worth change py-filelock implementation to use LockFile instead of _locking?
in my usecase, i'm trying to acquire the lock but if it is already locked I can ignore it and so other stuff. paying 1sec for each such check is crucial for me.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
OS: Win10/7
Python: 3.6.8
py-filelock: 3.0.12
I try to acquire a filelock without blocking (i.e. timeout=0). when the file is locked this operation takes 1sec (although should return immediately).
I did dome deep dive here and figured out that the reason is msvcrt.locking function (which implemented using _locking - even in a pure C++ project it takes 1sec to try acquire already locked file using _locking.
Using winapi LockFile doesn't have this problem - it returns immediately when the file is already locked .
Do you think it worth change py-filelock implementation to use LockFile instead of _locking?
in my usecase, i'm trying to acquire the lock but if it is already locked I can ignore it and so other stuff. paying 1sec for each such check is crucial for me.
Thanks!
The text was updated successfully, but these errors were encountered: