2020-08-29 19:35:41 +00:00
|
|
|
mod slice;
|
|
|
|
pub use slice::{ParallelSlice, ParallelSliceMut};
|
|
|
|
|
|
|
|
mod task;
|
|
|
|
pub use task::Task;
|
|
|
|
|
2020-09-16 01:05:31 +00:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
2020-08-29 19:35:41 +00:00
|
|
|
mod task_pool;
|
2020-09-16 01:05:31 +00:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
2020-08-29 19:35:41 +00:00
|
|
|
pub use task_pool::{Scope, TaskPool, TaskPoolBuilder};
|
|
|
|
|
2020-09-16 01:05:31 +00:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
mod single_threaded_task_pool;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
pub use single_threaded_task_pool::{Scope, TaskPool, TaskPoolBuilder};
|
|
|
|
|
2020-08-29 19:35:41 +00:00
|
|
|
mod usages;
|
2020-09-22 03:23:09 +00:00
|
|
|
pub use usages::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool};
|
2020-08-29 19:35:41 +00:00
|
|
|
|
2020-09-06 05:05:33 +00:00
|
|
|
mod countdown_event;
|
|
|
|
pub use countdown_event::CountdownEvent;
|
|
|
|
|
2020-09-08 19:18:32 +00:00
|
|
|
mod iter;
|
|
|
|
pub use iter::ParallelIterator;
|
|
|
|
|
2020-08-29 19:35:41 +00:00
|
|
|
pub mod prelude {
|
|
|
|
pub use crate::{
|
2020-09-08 19:18:32 +00:00
|
|
|
iter::ParallelIterator,
|
2020-08-29 19:35:41 +00:00
|
|
|
slice::{ParallelSlice, ParallelSliceMut},
|
2020-09-22 03:23:09 +00:00
|
|
|
usages::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool},
|
2020-08-29 19:35:41 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn logical_core_count() -> usize {
|
|
|
|
num_cpus::get()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn physical_core_count() -> usize {
|
|
|
|
num_cpus::get_physical()
|
|
|
|
}
|