-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Propagate Darwin vouchers across async tasks. #39115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a736986
to
9015584
Compare
9015584
to
6e22423
Compare
Updated with naming feedback, less nasal-demon-y access to |
6e22423
to
c04c587
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from an interaction with the OS voucher API perspective, thanks!
@swift-ci please test |
Build failed |
c04c587
to
c6c3dc6
Compare
@swift-ci please test |
Build failed |
c6c3dc6
to
c55c85b
Compare
@swift-ci please test |
Build failed |
c55c85b
to
e35e05b
Compare
@swift-ci please test |
Darwin OSes support vouchers, which are key/value sets that can be adopted on a thread to influence its execution, or sent to another process. APIs like Dispatch propagate vouchers to worker threads when running async code. This change makes Swift Concurrency do the same. The change consists of a few different parts: 1. A set of shims (in VoucherShims.h) which provides declarations for the necessary calls when they're not available from the SDK, and stub implementations for non-Darwin platforms. 2. One of Job's reserved fields is now used to store the voucher associated with a job. 3. Jobs grab the current thread's voucher when they're created. 4. A VoucherManager class manages adoption of vouchers when running a Job, and replacing vouchers in suspended tasks. 5. A VoucherManager instance is maintained in ExecutionTrackingInfo, and is updated as necessary throughout a Job/Task's lifecycle. rdar://76080222
e35e05b
to
a80a19b
Compare
@swift-ci please test |
Darwin OSes support vouchers, which are key/value sets that can be adopted on a thread to influence its execution, or sent to another process. APIs like Dispatch propagate vouchers to worker threads when running async code. This change makes Swift Concurrency do the same.
The change consists of a few different parts:
rdar://76080222