bevy/crates/bevy_tasks/src/lib.rs
Tomasz Sterna 2b0ee24a5d
Implement single threaded task scheduler for WebAssembly (#496)
* Add hello_wasm example

* Implement single threaded task scheduler for WebAssembly
2020-09-15 18:05:31 -07:00

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()
}