[WIP]: Threading (macOS): implement set_name#96
Closed
Phatcat wants to merge 1 commit intoEmberEmu:developmentfrom
Closed
[WIP]: Threading (macOS): implement set_name#96Phatcat wants to merge 1 commit intoEmberEmu:developmentfrom
Phatcat wants to merge 1 commit intoEmberEmu:developmentfrom
Conversation
6f952de to
08260f5
Compare
daf94c0 to
c298ea9
Compare
Macos has affinity requesting if using the policy for it, there is no dictating to the threads, it's only requesting. Create a signal handler with a feedback flag and yield until we're sure the name is set (probably only needed for the unit_test because it doesn't give the mac thread scheduler a chance)
Member
|
Thanks for the PR but this is going to be too brittle to go in. If they don't properly support it, it's better to go without. |
Contributor
Author
|
You do you. |
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.
A name cannot be set directly on another thread, it can only be set on itself, but it can be staged as a self instruct and send it off with a signal handler to another thread. This can be used for reporting back on the status of the request. This is needed in order to achieve unity where the function throws an error if it fails; we need feedback to know if it failed.
Sadly not as direct or controlled as on windows/linux, but it's possible. Removing the check can result in a bad read during a race condition.
The tester for instance is one such case as it doesn't give the scheduler enough time to process the request but instead immediately requesting a get_name and failing - give it 1 microsecond or allow the flag to report back and it passes, so it's not that mac doesn't want to set the name, it just wants to do it on it's own accord...