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

Feature request: Stop-the-world mechanism #83

Closed
playXE opened this issue Apr 12, 2020 · 1 comment
Closed

Feature request: Stop-the-world mechanism #83

playXE opened this issue Apr 12, 2020 · 1 comment

Comments

@playXE
Copy link

playXE commented Apr 12, 2020

It would be nice to see some API to stop execution of all coroutines and then resuming them.

may::park_all();
/* do something */
may::unpark_all();

park_all and unpark_all could be executed in both non-coroutine and coroutine contexts.

Implementation

It's possible to have static PARK_ALL: AtomicBool and at yeach yield to scheduler context check PARK_ALL. But STW mechanism might also require to store coroutine or context that requested STW to resume this context.

@Xudong-Huang
Copy link
Owner

Doing the check in the scheduler is better. But this will hurt the overall performance. I don't think will support this feature in the master branch.

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