Skip to content
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

Avoid deadlocks in multi-threaded management of the C# script map #99539

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Nov 22, 2024

The idea here is that using a read-write locking instead of all-or-nothing reduces the chances of a deadlock.

I'm not sure if this covers every possibility of such, because the interaction between, say, multiple resource loading threads instantiating C# scripts and the .NET module can be complex. All I can say is that this at least stops me from being able to reproduce the issue with the MRP provided.

Note for reviewers: Disable whitespace diff as one of the methods has a change of indentation level that makes the patch look more complex than it actually is.

Fixes #99128.
Fixes #99839 (I haven't been able to reproduce the issue with the MRP, even after modifying it to effectively use multiple loader threads; however, it's extremely likely that the issue the reporter found is fixed by this PR).

@RandomShaper RandomShaper added bug topic:dotnet cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 22, 2024
@RandomShaper RandomShaper added this to the 4.4 milestone Nov 22, 2024
@RandomShaper RandomShaper requested a review from a team as a code owner November 22, 2024 13:07
@RandomShaper RandomShaper force-pushed the fix_dotnet_rl_deadlock branch from 5c94f0b to f8f5505 Compare December 3, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:dotnet
Projects
None yet
2 participants