Skip to content

[Concurrency] Split out the default cooperative executor into a separate opt-in library #77032

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

Conversation

kubamracek
Copy link
Contributor

Currently, the Embedded Swift's libswift_Concurrency.a includes an implementation of a default cooperative executor (via CooperativeGlobalExecutor.cpp) inside, and the mechanism to use a user-provided executor instead relies on the linker preferring code from a .o file and/or order of libraries listed on the linker time. This feels unintuitive and possibly error prone, so this PR changes the setup: Instead, libswift_Concurrency.a stops including any global executor, and the user is expected to either explicitly link a new library, libswift_ConcurrencyDefaultExecutor.a, or link in their own executor. If they don't do either, they'll receive a (pretty self-explanatory) linker error about missing symbols like swift_task_enqueueGlobalImpl, etc.

@kubamracek
Copy link
Contributor Author

@swift-ci Please Build Toolchain macOS Platform

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci Please Build Toolchain macOS Platform

@al45tair
Copy link
Contributor

the mechanism to use a user-provided executor instead relies on the linker preferring code from a .o file and/or order of libraries listed on the linker time. This feels unintuitive and possibly error prone, so this PR changes the setup:

That makes me a bit sad; this was the normal way to do things back before dynamic linking and IDEs became popular and everyone forgot how linkers work :-) I suspect a lot of lower level embedded developers would still recognise this approach as they tend to interact with linkers more directly, but hey, the world appears to have moved on.

I think I agree that splitting it out is probably the right choice :-)

@kubamracek kubamracek force-pushed the embedded-split-out-default-executor branch from 86e4e24 to 2358cc9 Compare October 17, 2024 05:49
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek merged commit ce83bf7 into swiftlang:main Oct 17, 2024
5 checks passed
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.

2 participants