From ef0fb72364b7532c19fb548d3d5074484be98436 Mon Sep 17 00:00:00 2001 From: Anatoly Volkov Date: Fri, 12 Jul 2024 03:27:25 -0700 Subject: [PATCH] Add arena initialization --- cpp/daal/src/threading/threading.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/daal/src/threading/threading.cpp b/cpp/daal/src/threading/threading.cpp index b0c4f696ac6..8904414bf47 100644 --- a/cpp/daal/src/threading/threading.cpp +++ b/cpp/daal/src/threading/threading.cpp @@ -55,6 +55,7 @@ ThreaderEnvironment::~ThreaderEnvironment() std::cout << "delete task arena" << std::endl; delete reinterpret_cast(_taskArena); _taskArena = nullptr; + std::cout << "after delete task arena" << std::endl; } } void ThreaderEnvironment::setNumberOfThreads(size_t value) @@ -67,7 +68,9 @@ void ThreaderEnvironment::setNumberOfThreads(size_t value) } if (value > 1) { - _taskArena = reinterpret_cast(new tbb::task_arena(value)); + tbb::task_arena* arenaPtr = new tbb::task_arena(value); + arenaPtr->initialize(); + _taskArena = reinterpret_cast(arenaPtr); } _numberOfThreads = value; }