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

Add a uv backend to core::run #6436

Closed
brson opened this issue May 12, 2013 · 4 comments
Closed

Add a uv backend to core::run #6436

brson opened this issue May 12, 2013 · 4 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@brson
Copy link
Contributor

brson commented May 12, 2013

When running in a scheduler event loop, core::run should defer to the event loop for running processes. This will avoid blocking waitpid calls.

@alexcrichton
Copy link
Member

I'm currently working on this, within the week I should have a pull request or at least a branch to github posted. I'm not redesigning core::run yet, but rather reimplementing the current interface on top of libuv.

@alexcrichton
Copy link
Member

After lots of false starts, I believe that this is blocked on joyent/libuv#887 unless we want to concoct a workaround which runs all process events in one and only one event loop.

@alexcrichton
Copy link
Member

I've got a temporary patch from one of the node contributors on that issue, and now libuv upgrades and process bindings are on their way soon.

@alexcrichton
Copy link
Member

Keeping this updated again, my work is at https://github.com/alexcrichton/rust/tree/issue-6436-run-non-blocking. Tonight I fixed two problems:

  1. If you dropped a process that failed to spawn you just deadlocked forever (should have had an assertion preventing this).
  2. If you fail to spawn, you still need to call uv_close on the handle you passed into uv_spawn because it doesn't de-initialize it (even though it wasn't initialized beforehand...)

Regardless, now I've almost made it through make check. This gets all the way to running the rpass benchmarks, and then I hit a deadlock again. Will continue investigating, and will try to keep this updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

2 participants