bevy/crates/bevy_tasks/src/lib.rs

42 lines
941 B
Rust
Raw Normal View History

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 {
#[doc(hidden)]
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()
}