Skip to content

Progress towards storing task/executor state in thread-local storage #36079

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

Merged
merged 4 commits into from
Feb 22, 2021

Conversation

rjmccall
Copy link
Contributor

No description provided.

@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - fd436183fe032fdd93bc08c378652e767fda2f5c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - fd436183fe032fdd93bc08c378652e767fda2f5c

NFC except that I added swift_errorRetain and swift_errorRelease
functions on non-ObjC targets so that we have consistent
functions to call in the runtime.  I have not changed everywhere
in the runtime to use these, nor have I changed the compiler to
call them.
First, just call an async -> T function instead of forcing the caller
to piece together which case we're in and perform its own copy.  This
ensures that the task is actually kept alive properly.

Second, now that we no longer implicitly depend on the waiting tasks
being run synchronously, go ahead and schedule them to run on the
global executor.

This solves some problems which were blocking the work on TLS-ifying
the task/executor state.
r11 is the linker scratch register, so we need to make sure that
we don't end up in the linker when making cross-library direct
async calls.  Since there are currently only a few special
symbols that we do that for, we can achieve this by disabling
lazy binding for those symbols specifically.
@rjmccall
Copy link
Contributor Author

@swift-ci Please test

@rjmccall rjmccall force-pushed the thread-local-task-state branch from fd43618 to fd96f41 Compare February 22, 2021 07:43
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - fd436183fe032fdd93bc08c378652e767fda2f5c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - fd436183fe032fdd93bc08c378652e767fda2f5c

@rjmccall rjmccall merged commit dcc1292 into swiftlang:main Feb 22, 2021
@rjmccall rjmccall deleted the thread-local-task-state branch February 22, 2021 17:06
@compnerd
Copy link
Member

I think that this change may have further regressed the Windows CI: https://ci-external.swift.org/job/oss-swift-windows-x86_64-vs2019/4429/console

@shahmishal - seems that the CI didn't trigger here?

trackingInfo.leave();
}

void swift::runJobInExecutorContext(Job *job, ExecutorRef executor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, awesome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants