-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miscellaneous ReaderWriterLockSlim issues #8710
Comments
- Stop spinning for _myLock when deprioritized and the timeout expires, as deprioritized means the intended progress cannot be made on the RW lock Fixes #13254: - In the TryEnter* functions the conditions checked before the spin loop are now done inside the spin loop to account for reentrancy due to message pumping during a wait (including Sleep and WaitOne), during which the RW lock state may change. - Refactored condition checking in the spin loop to do some before and after the loop and some at the top of the loop, to minimize negative perf impact on the common fast paths - Exception cases are rechecked upon timeout in case of a state change - An exception from GetThreadRWCount(dontAllocate: false) is accounted for. Upon OOM, it previously could have led to not exiting _myLock, hanging subsequent uses of the RW lock. - When attempting to acquire a write lock, if the thread became a waiter and got signaled but failed to acquire the write lock, it now wakes up read waiters as they would otherwise be blocked by the write waiter. This was previously only handled for the case where the wait times out, it is now handled on all paths.
- Stop spinning for _myLock when deprioritized and the timeout expires, as deprioritized means the intended progress cannot be made on the RW lock Fixes #13254: - In the TryEnter* functions the conditions checked before the spin loop are now done inside the spin loop to account for reentrancy due to message pumping during a wait (including Sleep and WaitOne), during which the RW lock state may change. - Refactored condition checking in the spin loop to do some before and after the loop and some at the top of the loop, to minimize negative perf impact on the common fast paths - Exception cases are rechecked upon timeout in case of a state change - An exception from GetThreadRWCount(dontAllocate: false) is accounted for. Upon OOM, it previously could have led to not exiting _myLock, hanging subsequent uses of the RW lock. - When attempting to acquire a write lock, if the thread became a waiter and got signaled but failed to acquire the write lock, it now wakes up read waiters as they would otherwise be blocked by the write waiter. This was previously only handled for the case where the wait times out, it is now handled on all paths.
- Stop spinning for _myLock when deprioritized and the timeout expires, as deprioritized means the intended progress cannot be made on the RW lock Fixes #13254: - In the TryEnter* functions the conditions checked before the spin loop are now done inside the spin loop to account for reentrancy due to message pumping during a wait (including Sleep and WaitOne), during which the RW lock state may change. - Refactored condition checking in the spin loop to do some before and after the loop and some at the top of the loop, to minimize negative perf impact on the common fast paths - Exception cases are rechecked upon timeout in case of a state change - An exception from GetThreadRWCount(dontAllocate: false) is accounted for. Upon OOM, it previously could have led to not exiting _myLock, hanging subsequent uses of the RW lock. - When attempting to acquire a write lock, if the thread became a waiter and got signaled but failed to acquire the write lock, it now wakes up read waiters as they would otherwise be blocked by the write waiter. This was previously only handled for the case where the wait times out, it is now handled on all paths.
Nice to have, but it is not clear that it would have any significant impact, not likely to happen until a significant issue is shown to substantiate the work |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
The text was updated successfully, but these errors were encountered: