mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 03:23:20 +00:00
2b0ee24a5d
* Add hello_wasm example * Implement single threaded task scheduler for WebAssembly
40 lines
922 B
Rust
40 lines
922 B
Rust
mod slice;
|
|
pub use slice::{ParallelSlice, ParallelSliceMut};
|
|
|
|
mod task;
|
|
pub use task::Task;
|
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
mod task_pool;
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
pub use task_pool::{Scope, TaskPool, TaskPoolBuilder};
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
mod single_threaded_task_pool;
|
|
#[cfg(target_arch = "wasm32")]
|
|
pub use single_threaded_task_pool::{Scope, TaskPool, TaskPoolBuilder};
|
|
|
|
mod usages;
|
|
pub use usages::{AsyncComputeTaskPool, ComputeTaskPool, IOTaskPool};
|
|
|
|
mod countdown_event;
|
|
pub use countdown_event::CountdownEvent;
|
|
|
|
mod iter;
|
|
pub use iter::ParallelIterator;
|
|
|
|
pub mod prelude {
|
|
pub use crate::{
|
|
iter::ParallelIterator,
|
|
slice::{ParallelSlice, ParallelSliceMut},
|
|
usages::{AsyncComputeTaskPool, ComputeTaskPool, IOTaskPool},
|
|
};
|
|
}
|
|
|
|
pub fn logical_core_count() -> usize {
|
|
num_cpus::get()
|
|
}
|
|
|
|
pub fn physical_core_count() -> usize {
|
|
num_cpus::get_physical()
|
|
}
|