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

adding support for no_std executor #7

Closed
wants to merge 4 commits into from

Conversation

richardanaya
Copy link

Hey all, let me know what you think!

F: Future<Output = T> + Send + 'static,
T: Send + 'static,
{
panic!("no threads on no_std environments")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Threads aren't necessary for spawning tasks, it's possible to have fully capable core-only executors, they're just going to necessarily be much more device specific than any using std.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, I thought someone might say something about this, I'm curious what people think should be done about these cases for no_std , a better message? no_std multithreading is a bit out of my knowledge base.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️ I would say that no_std users should likely just supply their own, it's unlikely that there's a decent one-size-fits-all approach possible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, I agree, i'm a web assembly dev and I don't even really have an option in this respect :)

@o0Ignition0o
Copy link
Contributor

Let's go for an other CI run to see how it goes.

@Stupremee
Copy link
Member

Hey @richardanaya
Any progress with the no_std executor?
Because I would like to have a no_std executor in the next release of agnostik

@richardanaya
Copy link
Author

@Stupremee not having good luck:

i'm getting a new error about from_generator not existing after doing a pull from master, and still getting an error on nightly ( after rustup update nightly ).

Also, I could still use an answer for what people think I should do for no_std multithreading.

@o0Ignition0o
Copy link
Contributor

Hey there :) Is there any way I can help ? I tried checking out the code, and rustc seemed to complain about phantomdata not implementing derefmut. I tried to look for a joinhandle of some sort but couldnt find one :)

Lemme know if theres anything i can do to help, i ll be available tomorrow (CET) :)

@o0Ignition0o
Copy link
Contributor

o0Ignition0o commented Apr 4, 2020

just ran into it, will try to figure it out :)

error[E0433]: failed to resolve: could not find `from_generator` in `future`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.
error: could not compile `agnostik`.

It should be fixed somewhere rust-lang/rust#69033

@richardanaya
Copy link
Author

richardanaya commented Apr 6, 2020

what really confused me about the from_generator issue is what is causing it. My library executor compiles on stable just fine. I could have sworn it only came from using async { } blocks, but I didn't see any blocks that would be used by runtime_nostd agnostic, its like something sneaky is leaking in.

@Stupremee
Copy link
Member

Stupremee commented Apr 7, 2020

I thought about this the last few days and came to a conclusion.
First, I'm sure we don't need your executor and just implement ourselves.
The methods should look like this:

  • spawn & spawn_blocking: Should be noop methods
  • block_on: call Future::poll until the future is ready

If you want you can add agnostik support to your executor library as soon as #4 is implemented

@richardanaya
Copy link
Author

Cool, closing this PR.

@cosmikwolf
Copy link

And 3.5 years later, no_std is still not implemented, and #4 is still not implemented.

maybe the lesson here is to take help when someone is offering for free. that way we would have a rust ecosystem with an abstraction layer that is compatible with no_std.

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.

5 participants