From b002c1485d26b2cbcaede258143613fdf2ad0aa1 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 4 Jan 2021 09:03:49 +0100 Subject: [PATCH] Fix of PrusaSlicer hangs on Linux when run with non standard task affinity #5661 --- src/libslic3r/Thread.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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