-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Use a ReaderWriterLockSlim in RcwCache #117792
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the Lock
implementation with a ReaderWriterLockSlim
in the RcwCache
class to address concurrency issues reported in GitHub issue #117775. The change aims to improve thread safety by providing appropriate read/write locking semantics for cache operations.
Key changes:
- Replace
Lock
withReaderWriterLockSlim
for better read/write concurrency control - Update method synchronization to use appropriate read/write locks based on operation type
- Convert from
lock
statements to explicit lock acquisition with proper try/finally blocks
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs
Show resolved
Hide resolved
@MihuBot benchmark Interop.ComWrappersTests.ParallelRCWLookUp |
Tagging subscribers to this area: @dotnet/interop-contrib |
The bot uses an allow list for running commands, added you now.
|
Looks like this fixes the regression! Thanks @MihaZupan for adding me to the allow-list! |
/ba-g timeouts |
This should fix #117775