Skip to content

[Concurrency] repair cooperative global executor #39092

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

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Aug 29, 2021

SWIFT_STDLIB_SINGLE_THREADED_RUNTIME mode has been broken for a long time.

This patch guards some includes and use of libdispatch headers so that platforms
that doesn't support libdispatch can build cooperative executor runtime.
And fixed missing implementations for cooperative mode.

CC: @MaxDesiatov

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

This patch guards some includes of libdispatch headers so that platforms
that doesn't support libdispatch can build cooperative executor runtime.
And fixed missing implementations for cooperative mode.
@MaxDesiatov MaxDesiatov requested review from ktoso and CodaFi August 29, 2021 18:40
@MaxDesiatov
Copy link
Contributor

@swift-ci please smoke test

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

LGTM, but I wonder if we should add some way to test if this mode works so we don't keep breaking it on accident?

Do we have any way to test such thing @DougGregor ?

@MaxDesiatov
Copy link
Contributor

@ktoso should the lack of tests block this PR from being merged? I'm not sure if there's any other way to test this other than adding Swift for WebAssembly target to the community CI build matrix. This "build configuration" can't be enabled with a driver flag I suppose, and we can't rebuild with different CMake flags on existing platforms, right?

@rjmccall
Copy link
Contributor

I have no problem landing this without testing in the short term, but yeah, I think it should be a goal to bring up CI to test the WebAssembly target ASAP.

@MaxDesiatov MaxDesiatov merged commit f6f756e into swiftlang:main Aug 31, 2021
MaxDesiatov pushed a commit that referenced this pull request Sep 7, 2021
This preset will be used by community CI for WebAssembly to ensure [single-threaded-runtime mode won't be broken again](#39092 (comment)) and enable us testing IRGen for WebAssembly in upstream.

Note that the current preset doesn't build stdlib for Wasm for now because some essential patches haven't been ported yet and build-script doesn't support it. But that should be enabled after that's supported.

This change is a part of SR-15168.
WowbaggersLiquidLunch pushed a commit to WowbaggersLiquidLunch/swift that referenced this pull request Mar 31, 2022
`SWIFT_STDLIB_SINGLE_THREADED_RUNTIME` mode has been broken for a long time.

This patch guards some includes and use of libdispatch headers so that platforms
that doesn't support libdispatch can build cooperative executor runtime.
And fixed missing implementations for cooperative mode.
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