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

Platform-backed, non-scheduler/runtime entangled IO #9488

Closed
olsonjeffery opened this issue Sep 25, 2013 · 1 comment
Closed

Platform-backed, non-scheduler/runtime entangled IO #9488

olsonjeffery opened this issue Sep 25, 2013 · 1 comment

Comments

@olsonjeffery
Copy link
Contributor

tl;dr -- wherein we converge on libuv

Some thoughts that I put in a ticket comment before realizing that they didn't really apply.. still wanted to save it, though.

the plan is somewhat roughly-sketched-out; i think it's something like:

  • do Towards a pluggable EventLoop, etc #9128
  • decide whether or how and at what API boundary to draw the line (possibly at the RtioFoo interfaces)
  • assuming the above bullet holds, re-implement all of the RtioFoo traits in a new module (a sibling to std::rt::uv), that uses "platform-backed" implementations using idiomatic APIs for each platform (so mostly POSIX/etc on linux, POSIX+NSFoo on OSX, win32 on windows, etc...) .

There would be stuff like RtioTimer (where we have std::io::timer::Timer probably implementing std::select::Select in the near future, unless we want to go down the rabbit hole and move std::select's entire impl to be behind the IoFactory.. then maybe we could do something rational at the per-platform/OS level) that might not translate cleanly. I'd love to identify a subset of the RtioFoo traits (or maybe at some other boundary? not sure) that we can definitely do all of in a notional std::rt::pb module (pb for platform-backed).

An additional caveat to the third bullet, above, is that these implementations would be "truly blocking" and would do no task-descheduling-magicks (as is done, currently, in uvio), so they could be conceivably used without the rust scheduler. Not sure how to get around in case(s) where the platform API is async (this is bound to come up, I'm sure). Hence my hedging as outlined in bullet 1. This fact (no scheduler/runtime interaction in pb) suggests that maybe it should live outside of std::rt.. std::unstable? Still the question of a common API between std::rt::io and pb, though.

@brson and I have had a few conversations about this in IRC, and I have a topic branch working towards #9128 in my local repo. But not much actual movement on this.

@alexcrichton
Copy link
Member

This is essentially done as libnative. Closing.

djkoloski pushed a commit to djkoloski/rust that referenced this issue Sep 21, 2022
Add `#[allow(unused)]` to test in `cargo dev new_lint`

`rustfix` tests don't automatically apply `-Aunused` which leads to some tests having `_workarounds`, add it to new test files automatically so people don't have to worry about it

changelog: none
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