Skip to content

[Concurrency] Support duration-based sleep in cooperative executor #42610

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 Apr 23, 2022

Repair the test failure of Concurrency/Runtime/clock.swift on CI with the cooperative executor enabled. See here for the failure log

The failure is just due to missing implementation, so this patch adds the support of the missing duration-based sleep for the cooperative executor.

@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

@kateinoigakukun
Copy link
Member Author

preset=buildbot_incremental_linux_crosscompile_wasm
@swift-ci Please test with preset Linux Platform

@kateinoigakukun kateinoigakukun force-pushed the katei/coop-deadline-job branch from e95d455 to 8c69fda Compare May 8, 2022 07:08
@MaxDesiatov
Copy link
Contributor

@swift-ci please smoke test

@ktoso
Copy link
Contributor

ktoso commented May 13, 2022

@phausler can you have a look here?


uint64_t delta = (sec - nowSec) * NSEC_PER_SEC + nsec - nowNsec;

auto deadline = std::chrono::steady_clock::now()
Copy link
Contributor

Choose a reason for hiding this comment

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

So I guess this implementation just ignores the clock parameter then, since this does not have a suspending style clock (std::chrono only has continuous)

I guess that makes sense w/ a single threaded runtime.

@kateinoigakukun kateinoigakukun merged commit f76552c into swiftlang:main May 14, 2022
@kateinoigakukun kateinoigakukun deleted the katei/coop-deadline-job branch May 14, 2022 00:55
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