Repository navigation
Fix data race (TSan report) on worker thread startup on macOS in iree_thread_request_affinity - #15534
Merged
Merged
Conversation
bjacob
approved these changes
Nov 10, 2023
benvanik
enabled auto-merge (squash)
November 10, 2023 17:28
benvanik
disabled auto-merge
November 10, 2023 17:31
Collaborator
Author
|
@bjacob pushed a commit with your fix handling both cases - I think should solve the race - mind giving it a shot? |
iree_thread_request_affinity"iree_thread_request_affinity
Collaborator
|
ok, trying! |
Collaborator
|
@benvanik , this works (no TSan error in |
Collaborator
Author
|
awesome, thanks for checking and for the fix! |
benvanik
enabled auto-merge (squash)
November 10, 2023 17:42
ramiro050
pushed a commit
to ramiro050/iree
that referenced
this pull request
Dec 19, 2023
…e_thread_request_affinity` (iree-org#15534) The thread having its affinity set is not the thread setting it; `mach_task_self()` != `thread->mach_port`. We'll want to fix the race while still having the same behavior when called from https://github.com/openxla/iree/blob/5b72c3908c8c216f3eee034ca74d61b8dbf37a12/runtime/src/iree/base/internal/threading_darwin.c#L141-L143 Reverts iree-org#15499 and rolls forward with fix.
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.
The thread having its affinity set is not the thread setting it;
mach_task_self()!=thread->mach_port. We'll want to fix the race while still having the same behavior when called from https://github.com/openxla/iree/blob/5b72c3908c8c216f3eee034ca74d61b8dbf37a12/runtime/src/iree/base/internal/threading_darwin.c#L141-L143Reverts #15499 and rolls forward with fix.