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

Async / executer #501

Open
mschnell1 opened this issue Nov 20, 2022 · 5 comments
Open

Async / executer #501

mschnell1 opened this issue Nov 20, 2022 · 5 comments

Comments

@mschnell1
Copy link

As the dual core paradigm is one of the key features of the Pico / 2040, Rust support would need to allow for async fn to be executed in parallel without introducing an operation system in the project but by simply distributing the tasks to the two cores with the "executer".
Is there already anything planned with such a goal ?
Thanks a lot for listening,
-Michael

@jannic
Copy link
Member

jannic commented Nov 20, 2022

As we don't have async support in rp-hal yet, the question of how the schedule async tasks to both cores isn't the most pressing one.

If you are interested in async rust on the rp2040, it's probably worth to have a look at https://github.com/embassy-rs/embassy. However, I have no idea if they have multi-core support.

@mschnell1
Copy link
Author

mschnell1 commented Nov 20, 2022

In fact, I am interested in concurrent execution on the cores without the need of an OS.
In fact it does not seem too intimidating to do an async executer that only supports two concurrent tasks by means of the cores. I'll have a look, once I actually am able to write fluently Rust code :)
Thanks a lot !
(BTW.: Exited to see you here :) :) :) )

@ithinuel
Copy link
Member

ithinuel commented Nov 20, 2022

For what it's worth, I am running a nostd_async executor on each core on wilskeeb.
https://github.com/ithinuel/wilskeeb/blob/develop/firmware/src/main.rs#L544-L562

Tasks don't get passed from one core to the other because that'd involve some extra requirement that I didn't want to spend time on.

Each executor is able to run several tasks in "parallel" (that's the whole point of async).

@mschnell1
Copy link
Author

mschnell1 commented Nov 20, 2022

Am I wrong assuming, that by "async fn" and "future" in principle any type of real or virtual parallelism can be handled, and it depends on the executor (using an OS, if present) which kind is in charge (e.g. single core scheduler, SMP, or - e.g. with 2040 (without OS and low complexity executor) , dual core (limited to two tasks) ?
(A typical application for such async paradigm could be speeding up matrix multiplication.)
-Michael (btw no real application fur this right now, just ranting about what might be desirable. My current would be Rust project just needs two distinct applications running on a core each.)

@9names
Copy link
Member

9names commented Nov 20, 2022

In this context: async gets you concurrency, not parallelism.

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

4 participants