0030959: OSD_Parallel_TBB: number of execution threads is strictly limited by the...
authoroan <oan@opencascade.com>
Wed, 11 Sep 2019 08:04:03 +0000 (11:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 14 Sep 2019 07:49:48 +0000 (10:49 +0300)
Do not limit number of available threads by number of items processed within the root scope due to possibility of spawning of an additional threads within the subscopes.

src/OSD/OSD_Parallel_TBB.cxx

index 43b6ec1..9179f8d 100644 (file)
@@ -40,7 +40,7 @@ void OSD_Parallel::forEachExternal (UniversalIterator& theBegin,
   {
     const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
     const Standard_Integer aNbThreads = theNbItems > 0 ?
-      Min (theNbItems, aThreadPool->NbDefaultThreadsToLaunch()) : -1;
+      aThreadPool->NbDefaultThreadsToLaunch() : -1;
 
     tbb::task_scheduler_init aScheduler (aNbThreads);
     tbb::parallel_for_each (theBegin, theEnd, theFunctor);