-
Notifications
You must be signed in to change notification settings - Fork 634
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 use_atomic feature #627
Conversation
Thanks for the PR! I'm pretty wary about this though as it basically turns off most of the library. I don't think we're quite ready to have a world without atomics and a |
What platform does not include atomics? |
@carllerche thumbv6m-none-eabi, which is used for microcontrollers based on ARM Cortex M0, M0+, and M1. The specific board I'm trying to use is an Arduino Zero. |
@ealasu I don't think we're going to be able to take this PR at this time. Most of this library is engineered around the existence of the task system which is itself engineered around the existence of atomics. It's sort of unclear how we would implement the library beyond the literal Is it critical that the |
@alexcrichton I've found the Future & Stream traits quite useful on their own, as an API for writing portable asynchronous code.
If the futures crate didn't support the Cortex-M0 platform, it would be more difficult to write asynchronous code like this that supported both Cortex-M0 and tokio. |
Oh yeah I don't disagree that they can be useful abstractions, but my point is that in the case where you don't have a task system or any atomics at all I think the utility for a "shared abstraction" is greatly reduced, and it's effectively equivalent to having a local vendored trait at that point. |
There are some useful crates that depend on |
@ealasu sure yeah but in general this is something that's going to be very difficult to maintain over time. Most maintainers are pretty used to a std/core split but AFAIK few are used to atomic/no atomic splits. I, for example, have no experience maintaining a no-atomic platform. |
Ok I'm going to close this for now as I don't think we'll get very far in futures without atomics, but we can of course continue discussion in the issue tracker if you'd like! |
Fixes #622