diff --git a/crates/bevy_app/src/task_pool_plugin.rs b/crates/bevy_app/src/task_pool_plugin.rs index d2146d9a65a46..91d327c5dee6a 100644 --- a/crates/bevy_app/src/task_pool_plugin.rs +++ b/crates/bevy_app/src/task_pool_plugin.rs @@ -12,7 +12,7 @@ use alloc::string::ToString; use bevy_platform_support::sync::Arc; use bevy_tasks::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder}; use core::{fmt::Debug, marker::PhantomData}; -use log::trace; +use log::{trace, warn}; #[cfg(not(target_arch = "wasm32"))] use {crate::Last, bevy_ecs::prelude::NonSend}; @@ -158,7 +158,14 @@ impl Default for TaskPoolOptions { impl TaskPoolOptions { /// Create a configuration that forces using the given number of threads. + /// + /// Warns for values below 3 as three minimum are needed for the default pool assignments (IO, Async and Compute pools each need at least one thread). pub fn with_num_threads(thread_count: usize) -> Self { + if thread_count < 3 { + warn!( + "The default TaskPoolOptions thread assignment policies require a minimum of one thread each for the IO, Async, and Compute pools. Three threads will be assigned." + ); + } TaskPoolOptions { min_total_threads: thread_count, max_total_threads: thread_count,