-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Task Executors: Prepare for new TaskExecutor protocol #69568
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
Task Executors: Prepare for new TaskExecutor protocol #69568
Conversation
b13c21c
to
9e75142
Compare
@swift-ci please smoke test |
@swift-ci please smoke test |
include/swift/ABI/Executor.h
Outdated
|
||
/// Deprecated name for "SerialExecutorRef"; When it was first introduced it was ExecutorRef, | ||
/// but it always meant specifically a serial executor. | ||
typedef SerialExecutorRef ExecutorRef; |
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.
Do we need this? Is there code using this header outside our repository?
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.
Probably not, let me remove this.
@rokhinip I don't think you're using the actual header from Swift anywhere right? If anything it would have been a copy I expect.
include/swift/AST/Builtins.def
Outdated
/// reference. | ||
BUILTIN_MISC_OPERATION_WITH_SILGEN(BuildOrdinaryTaskExecutorRef, | ||
"buildOrdinaryTaskExecutorRef", "n", Special) | ||
|
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.
I don't know that you need to copy this stuff about builtins. Let's wait until we have a need to build task executors into the compiler.
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.
Okey yeah we can add when necessary, thanks!
@swift-ci please smoke test and merge |
Addressed comments, this is just the rename and adding the new type then |
This prepares for the addition of a TaskExecutor protocol that will enable us to "run on the thread of the task executor, however be isolated to the actor".
Next we'll start tracking BOTH in executor tracking and adjust enqueue / actor drain code to respect these as well.
The APIs to set one of these are outlined in swiftlang/swift-evolution#2187 which details the withExecutor and Task(on: TaskExecutor) performance tuning APIs. They allow to "not switch off the task's preferred executor".