Skip to content
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

Is currently exec::schedule_after() supported on MSVC or MinGW? #1102

Open
denchat opened this issue Oct 10, 2023 · 2 comments
Open

Is currently exec::schedule_after() supported on MSVC or MinGW? #1102

denchat opened this issue Oct 10, 2023 · 2 comments

Comments

@denchat
Copy link

denchat commented Oct 10, 2023

From the example folder, it seems that only io_uring_scheduler supports exec::schedule_after() .

exec::io_uring_context context;
exec::io_uring_context context2;
std::thread io_thread{[&] {
context.run();
}};
std::thread io_thread2{[&] {
context2.run();
}};
auto scheduler = context.get_scheduler();
auto scheduler2 = context2.get_scheduler();
using namespace std::chrono_literals;
stdexec::sync_wait(exec::when_any(
exec::schedule_after(scheduler, 1s) | stdexec::then([] { std::cout << "Hello, 1!\n"; }),
exec::schedule_after(scheduler2, 2s) | stdexec::then([] { std::cout << "Hello, 2!\n"; })
| stdexec::upon_stopped([] { std::cout << "Hello, 2, stopped.\n"; })));


Found usage examples only in io_uring:

https://github.com/search?q=repo%3ANVIDIA%2Fstdexec%20%20exec%3A%3Aschedule_after(&type=code

@maikel
Copy link
Collaborator

maikel commented Oct 10, 2023

We could certainly implement a thread scheduler that satisfies the timed scheduler concept. I'm sure that @kirkshoop has already something in a branch.

Do you have a running setup on windows? Support on windows is limited and is currently being improved by @vasama

@maikel
Copy link
Collaborator

maikel commented Oct 10, 2023

I found kirks implementation here https://github.com/kirkshoop/stdexec/blob/kirkshoop/wip-time-scheduler/include/exec/thread_scheduler.hpp

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

No branches or pull requests

2 participants