[core] Make TROOT::GetFunction more thread-safe - #23222
Draft
vepadulano wants to merge 1 commit into
Draft
Conversation
This method uses a static-initialized atomic boolean modified by a static-initialized immediately-invoked lambda to ensure that either the queried function is returned if available or the ROOT standard functions are initialized before returning the queried function. This method while theoretically sound has the potential of being wrong because it introduces potential modifications to the fFunctions data member as well as interpreter access via TROOT::ProcessLine without following the locking strategy used in other places of ROOT core. This commit proposes to introduce the strategy of combining R__[READ,WRITE]_LOCKGUARD(ROOT::gCoreMutex) to ensure thread-safe querying and modification of the ROOT list of functions.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This method uses a static-initialized atomic boolean modified by a static-initialized immediately-invoked lambda to ensure that either the queried function is returned if available or the ROOT standard functions are initialized before returning the queried function.
This method while theoretically sound has the potential of being wrong because it introduces potential modifications to the fFunctions data member as well as interpreter access via TROOT::ProcessLine without following the locking strategy used in other places of ROOT core.
This commit proposes to introduce the strategy of combining R__[READ,WRITE]_LOCKGUARD(ROOT::gCoreMutex) to ensure thread-safe querying and modification of the ROOT list of functions.
This is related to the various attempts at fixing the
cpp11Containers-unorderedMapmacro-based test, see #22909 #23021 #23147 #23213