- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The TBB Reference Manual states that you can have more than one active task_scheduler_init object per thread. The question is now how can they be used. In parallel_for for example there's no possiblility to specify which task_scheduler_init object should be used.
Markus
Markus
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The possibility to have several active task_scheduler_init objects is mostly useful for modular programs, when a function might not know whether TBB has been initialized by the calling thread. So it can just create a task_scheduler_init object and let TBB decide about initialization. If there is another such object created before in the thread, the second one will just increment a reference counter.
Let me ask you, why have you asked about having more than one task_scheduler_init active? If you think you would make some use out of it, what would it be?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On systems with non-uniform memory access characteristics (e.g. ccNUMA) it would make sense to have thread teams running separately in each locality domain so that access locality constraints can be implemented. That way, thread teams could still load balance across the cores in a socket but only access local memory. Of course, data layout, pinning etc. have to be taken into account as well, but that can be handled as soon as we have solved the problem of separating thread teams. Parallel constructs like parallel_for would have to be modified as well, of course.
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