What asynchronous runtime does bevy use for concurrency? #9287
-
Pretty much as it says on the tin. I don't see the common rust asynchronous runtimes in cargo.toml (tokio, rayon, futures), yet on the front page of the bevy website, Bevy advertises "Lock-Free Parallel Scheduler", which would indicate that an asynchronous runtime is used for processing. What runtime does Bevy use for concurrency? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
tl;dr Bevy supports regular futures and parallel iterators. It does not depend on a "full" async I/O lib like tokio. Not an expert on the topic, just looking at the bevy_task crate. It depends on these: bevy/crates/bevy_tasks/Cargo.toml Lines 16 to 20 in 0566e73 These are the same crates used by smol, a small alternative to tokio. The main feature is that bevy_tasks has a thread pool to run futures/tasks. The async compute example shows one way of using it, another is shown in the parallel query example (this is almost like rayon but using the bevy_task thread pool). |
Beta Was this translation helpful? Give feedback.
tl;dr Bevy supports regular futures and parallel iterators. It does not depend on a "full" async I/O lib like tokio.
Not an expert on the topic, just looking at the bevy_task crate. It depends on these:
bevy/crates/bevy_tasks/Cargo.toml
Lines 16 to 20 in 0566e73
These are the same crates used by smol, a small alternative to tokio. The main feature is that bevy_tasks has a thread pool to run futures/tasks. The async compute example shows one way of using it, another is shown in the parallel query example (this is almost like rayon but…