Comments (2)
Here are my run logs
leak.txt
from onetbb.
Hi @lennoxho, I was able to reproduce described behavior.
TL;DR
It seems that task_arena
usage is a correct way to work-around this problem. Meanwhile, we will think what to do with the leak if task_arena
is not used.
So basically it happens because with global_control
you limit concurrency that all the internal arenas
can share between each other. Therefore, each particular arena doesn't not know its actual concurrency limit but only one you explicitly set during construction or for default arena
(one that will be used for simple parallel_for
call for example) the concurrency will be a whole machine.
When you start parallel_for
with static_partitioner
it will create as many internal proxy tasks
as normal tasks (proxy tasks
are used to assign tasks to specific threads). Proxy tasks have a property they should be executed twice. When execute
is called for the proxy task
for the first time it will return actual task that it propagated. When execute
is called for the second time proxy task can be deleted.
In your case each time you call parallel_for
with static_partitioner
it will create hardware_concurrency
proxy tasks
but because global_control
is present the concurrency of the default arena
will not be fully satisfied and some of the proxy tasks
will be called only once so they never be destroyed.
Perhaps, the solution will be to check min(arena::concurrency, global_control::limitation)
during execution of static_partitioner
.
from onetbb.
Related Issues (20)
- Avoid split constructor for the Range concept HOT 2
- Compiling TBB with recent GCC 13.2, 11.4 fails HOT 2
- Possible lifetime issue with parallel_scan over non trivially destructible range HOT 3
- WASM - linking to both `-ltbb` and `-ltbbmalloc` gives duplicate symbol error for `itt_notify` HOT 4
- Potential Array Out of Bounds and Redundant Code in create_record Function HOT 1
- Can't compile concurrent_vector with include winsock2.h or ws2tcpip.h HOT 5
- OpenBSD and NetBSD doesn't have the cpuset_* feature HOT 3
- Unable to use tbb.framework in an iOS app HOT 3
- WASM + Debug HOT 5
- tbb::global_control does not stop spinning threads HOT 1
- memset call with invalid value for fill character
- Dangling pointer HOT 1
- Re: Errors compiling Intel OneAPI TBB c++ include file concurrent_vector.h HOT 9
- "Set the oneAPI Environment" every time when I start VSCode!?! HOT 3
- Windows 11 missing tbb12_debug.dll! HOT 1
- `warning: ‘template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage’ is deprecated [-Wdeprecated-declarations]` HOT 1
- Error Linking CXX shared library ../../gnu_14.1_cxx11_32_release/libtbb12.dll
- Uninitialized data member in test code
- armel: Compiling a project using tbb via cmake yields: undefined reference to symbol '__atomic_fetch_add_8@@LIBATOMIC_1.0'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onetbb.