[mini] Use atomics, instead of loader lock, for JIT wrappers#100925
Closed
lambdageek wants to merge 2 commits intodotnet:mainfrom
Closed
[mini] Use atomics, instead of loader lock, for JIT wrappers#100925lambdageek wants to merge 2 commits intodotnet:mainfrom
lambdageek wants to merge 2 commits intodotnet:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
lambdageek
commented
Apr 11, 2024
Comment on lines
+590
to
+591
| gconstpointer wrapper__; | ||
| gconstpointer trampoline__; |
Member
Author
There was a problem hiding this comment.
Ignore the renamed fields. I will remove this. Just want to see the build fail if there's any #ifdef uses of these that I missed
7f6152f to
9084c33
Compare
Member
Author
|
/azp run runtime-extra-platforms, runtime-community |
|
Azure Pipelines successfully started running 2 pipeline(s). |
This was referenced Apr 11, 2024
kg
reviewed
Apr 11, 2024
| } | ||
| } | ||
|
|
||
| /* LOCKING: does not take locks. does not use an atomic write to info->wrapper |
Member
Author
There was a problem hiding this comment.
I'll add to the comment. Because it's called single-threaded early during startup.
Related to dotnet#93686 While this doesn't eliminate all deadlocks related to the global loader lock and managed locks, it removes one unneeded use of the loader lock. The wrapper (and trampoline) of a JIT icall are only ever set from NULL to non-NULL. We can use atomics to deal with races instad of double checked locking. This was not the case historically, because the JIT info was dynamically allocated - so we used the loader lock to protect the integrity of the hash table
e12cd4b to
2702209
Compare
Contributor
|
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #93686
While this doesn't eliminate all deadlocks related to the global loader lock and managed locks, it removes one unneeded use of the loader lock.
The wrapper (and trampoline) of a JIT icall are only ever set from NULL to non-NULL. We can use atomics to deal with races instad of double checked locking. This was not the case historically, because the JIT info was dynamically allocated - so we used the loader lock to protect the integrity of the hash table