From 4df14044aa33c69c4e07a206620cfc649f90fbff Mon Sep 17 00:00:00 2001 From: Frederic Laing Date: Mon, 17 Nov 2025 17:07:35 +0100 Subject: [PATCH] make sure to not create more thumbnail workers than available CPU cores --- src/tab.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tab.rs b/src/tab.rs index c26bb0d..bda3dca 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -105,7 +105,7 @@ const THUMBNAIL_SIZE: u32 = (ICON_SIZE_GRID as u32) * (ICON_SCALE_MAX as u32); // Thumbnail generation semaphore - limits parallel thumbnail workers // Uses 4 workers for balanced throughput and memory usage pub static THUMB_SEMAPHORE: LazyLock = - LazyLock::new(|| tokio::sync::Semaphore::const_new(4)); + LazyLock::new(|| tokio::sync::Semaphore::const_new(num_cpus::get().min(4))); pub(crate) static SORT_OPTION_FALLBACK: LazyLock> = LazyLock::new(|| {