- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hej
In my application, I am specifying grainsize for parallel_for:blocked_range, which depends upon number of available/working threads. I specify number of threads by
task_scheduler_init initTBB(nthreads);
But during program execution, I want to confirm there are "nthreads" running, so is there any function/API that returns number of threads TBB has created?
In my application, I am specifying grainsize for parallel_for:blocked_range, which depends upon number of available/working threads. I specify number of threads by
task_scheduler_init initTBB(nthreads);
But during program execution, I want to confirm there are "nthreads" running, so is there any function/API that returns number of threads TBB has created?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Akhal,
TBB always creates nthreads passed to task_scheduler_init. So there is no need to ensure how many worker threads are created if you specified it explicitly.
In run time TBB scheduler manages tasks executed by the worker threads. If there is no enough job for some threads they will wait inactively. So the number of created threads is constant, but number of active worker threads at the moment is variable. Intention is to leave TBB runtime tobalance loadbetweenthe worker threads and manage number of worker threads at the moment.
Regards,
Kirill
TBB always creates nthreads passed to task_scheduler_init. So there is no need to ensure how many worker threads are created if you specified it explicitly.
In run time TBB scheduler manages tasks executed by the worker threads. If there is no enough job for some threads they will wait inactively. So the number of created threads is constant, but number of active worker threads at the moment is variable. Intention is to leave TBB runtime tobalance loadbetweenthe worker threads and manage number of worker threads at the moment.
Regards,
Kirill
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page