Skip to content

[threading] Switch domain assemblies lock from OS to Coop#32502

Merged
CoffeeFlux merged 1 commit intodotnet:masterfrom
CoffeeFlux:domain-assemblies-mutex-coop
Mar 2, 2020
Merged

[threading] Switch domain assemblies lock from OS to Coop#32502
CoffeeFlux merged 1 commit intodotnet:masterfrom
CoffeeFlux:domain-assemblies-mutex-coop

Conversation

@CoffeeFlux
Copy link
Contributor

I don't think you can create a root domain without reaching the thread info attach call, so this should be safe to change outright.

Fixes #32177

We should complete mono/mono#18915 and then convert over other locks as needed, but this fixes the immediate CI hang.

@vargaz
Copy link
Contributor

vargaz commented Feb 18, 2020

The problem seems to be that 'assemblies_lock' is not really a low level lock, its used for locking around a ton of code.

@CoffeeFlux
Copy link
Contributor Author

Yeah, anything iterating through the domain's domain_assemblies has to take it, which is a bunch of random places. Some of them could probably be cut down and forced to go through the normal loader behavior, but they'll still ultimately have to take the lock at some point so it should be coop instead of OS.

@CoffeeFlux CoffeeFlux force-pushed the domain-assemblies-mutex-coop branch from 210c48b to eb1c8da Compare February 18, 2020 22:10
I don't think you can create a root domain without reaching the thread info attach call, so this should be safe to change outright.
@CoffeeFlux CoffeeFlux merged commit 03b0c44 into dotnet:master Mar 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-threading-mono runtime-mono specific to the Mono runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hanging test in System.Reflection.Emit.Tests

4 participants