diff --git a/src/libslic3r/Thread.cpp b/src/libslic3r/Thread.cpp index ad3e60b71..d203acb90 100644 --- a/src/libslic3r/Thread.cpp +++ b/src/libslic3r/Thread.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include - #include "Thread.hpp" namespace Slic3r { @@ -195,7 +195,10 @@ void name_tbb_thread_pool_threads() return; initialized = true; - const size_t nthreads_hw = std::thread::hardware_concurrency(); + // see GH issue #5661 PrusaSlicer hangs on Linux when run with non standard task affinity + // TBB will respect the task affinity mask on Linux and spawn less threads than std::thread::hardware_concurrency(). +// const size_t nthreads_hw = std::thread::hardware_concurrency(); + const size_t nthreads_hw = tbb::this_task_arena::max_concurrency(); size_t nthreads = nthreads_hw; #ifdef SLIC3R_PROFILE