- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I wanted to know whether TBB uses thread pool. In one of my applications I am
calling parallel_for for large number of times so I wanted to know if threads are
created during initialization or when parallel_for is called ?
Thanks,
Chaman Singh Verma
Poona, India
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, Intel TBB does use a thread pool. The default number of threads added for that pool is one less than the number of Processing Elements available on the system so that with the creating thread, the pool comprises one thread per PE. This pool size can be overridden when a TBB program creates its task_scheduler_init object. Threads in this pool persist until the task_scheduler_init object is destroyed. To avoid thread pool thrashing (creation, destruction and recreation of the pool), you should create the task_scheduler_init object at a place in your code where its lifetime will span any TBB parallel constructs that may be invoked during execution.

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