- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For example I may have created 8 threads by 'task_scheduler_init', but I would like a certain call to 'parallel_for' to use only 3 of those threads. I would like to specify this for each algorithm call independently.
My reasons to want this:
1) Memory usage increases as the number of used threads (living task objects) increases.
2) As the number of threads increases, memory access may start to be the performance bottleneck instead of the CPU.
I thought about 2 solutions but dropped both:
1) Create separate instances of 'task_scheduler_init' for each parallel algorithm call. I can not do this, becasue some of our software components use thread local storage heavily, hence thread creation is considered resource hungry, therefore a company policy is established to create threads only once: at application startup.
2) Provide special partitioner parameter for 'parallel_for' limiting the number of ranges. I do not like this solution, because 1) the partitioner parameter was not designed for this purpose, 2) by this I would lose the ability to fine-grain load balancing, 3) this approach may not be possible for other algorithms than 'parallel_for'.
Thank for the replies
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anton Malakhov (Intel) wrote:
Please consider class task_arena (community preview feature)
Thank you.
It looks what I want.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page