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

Switch to async io to avoid spawning three OS threads per command #197

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

soenkehahn
Copy link
Owner

Without this PR cradle spawns 3 OS threads (with std::thread::spawn) per executed child process. These are used to write to stdin and read from stderr and stdout. This PR switches to using tokio and async io. This may be good, since -- at least on linux -- OS threads are not super efficient.

This is currently just a WIP PR.

One open question: Can we even start a tokio runtime without destroying the ability of library users to use async runtimes themselves?

@soenkehahn soenkehahn marked this pull request as draft October 28, 2021 04:14
@soenkehahn soenkehahn force-pushed the async branch 7 times, most recently from 174f3cb to 7c8dc8c Compare October 29, 2021 04:24
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.

1 participant