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

WIP: no_std support for async macro #935

Closed
wants to merge 3 commits into from

Conversation

Nemo157
Copy link
Member

@Nemo157 Nemo157 commented Apr 3, 2018

All changes in the first commit should be good to go.

The second commit has a SUPER UNSAFE implementation of context passing. It works in my specific use case because I promise to never touch futures in interrupt handlers and run on a single-threaded microcontroller, but definitely needs to be implemented differently to ensure users can't accidently pass the wrong context to different futures.

I have had a brief look at how futures 0.1 handled supporting basically a user overridable thread local implementation, putting the onus of safety on the user that called futures::task::init. I would really love to avoid having to reintroduce that API (especially having to fully understand that implementation, there appeared to be a lot of implementation details concerned with ensuring any cost introduced by it is optimized out on std builds), so any hints on potential alternatives would be greatly appreciated.

If no-one has any potential alternatives, I'll take a better look at the old futures::task::init sometime this/next week and see how horrible supporting it will be.

@Nemo157
Copy link
Member Author

Nemo157 commented Apr 21, 2018

I never came up with a nice solution to this that doesn't involve changing the definition of generators in the compiler, I'm going to abandon this on 0.2 for now and maybe getting something working for 0.3 (depending on how far away the builtin async support will be).

@Nemo157 Nemo157 closed this Apr 21, 2018
@Nemo157 Nemo157 deleted the no_std-await branch February 16, 2019 16:18
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.

None yet

1 participant