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

Avoid polling when waiting on channels #288

Closed
daviddrysdale opened this issue Oct 22, 2019 · 3 comments
Closed

Avoid polling when waiting on channels #288

daviddrysdale opened this issue Oct 22, 2019 · 3 comments
Assignees

Comments

@daviddrysdale
Copy link
Contributor

Possibly based on absl::Notification (although that says multiple calls to Notify() are undefined behaviour, so it's not an immediate fit).

@blaxill
Copy link
Contributor

blaxill commented Feb 10, 2020

The rust runtime also currently uses sleep. We should instead implement correct thread suspension. This could possibly be based on Condvar in rust or through some use of the future framework.

@blaxill
Copy link
Contributor

blaxill commented Feb 10, 2020

Some notes

  • crossbeam appears to spin for no_std link

  • crossbeam wait_group example - a simple example of multiple threads waiting on a single Condvar

  • The wait_on_channels case is the most difficult as a single Condvar isn't enough.

  • Futures with no_std support is mixed as any actual implementations need OS support for thread-things.

  • Assuming we go with an enclave abstraction layer, this PR will likely use sync primitives defined there

@daviddrysdale
Copy link
Contributor Author

For the C++ side of this, I've dumped my experiments into #589.

Also, there's some interesting and possibly relevant stuff in "Go channels on steroids"

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