- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have an application with multiple parallel regions (with serial portions in between), each having different characteristics in terms of scalability (i.e. some scale strongly, other weakly, etc.), and thus different requirements in terms of optimal number of cores to use. Is it possible in TBBs to dynamically change the number of worker threads for a specific parallel region? Would the creation of multiple task_scheduler_init objects in different scopes (i.e. "{ }" blocks) work? Ideally, I would like to avoid the continuous creation/destruction of worker threads (due to the relatively large overhead), and employ a less disruptive scheme to suspend/resume workers on demand.
Thanks in advance,
Nick
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
- 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
- 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
jimdempseyatthecove wrote:I would like to maintain the so-called "parallel slackness" property (tasks >> workers) that libraries such as Cilk or TBBs implement, and which subsequently guarantees proper load balancing. I am not sure that the solution you propose would maintain that. But anyway, my applications do not only include parallel skeletons with partitionable iteration spaces (e.g. parallel_for), but also other constructs such as raw tasks.Why not manage the number of threads per region of you code by managing the number of tasks generated to execute those regions. Example: create a partitioner that places an upper limit on the number of partitions.
Jim Dempsey
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Raf Schietekat wrote:OK. Here is another question: I was browsing the TBB source code to find functionality related to adding/removing workers. I came up to the following function in market.h: //! Request that arena's need in workers should be adjusted. /** Concurrent invocations are possible only on behalf of different arenas. **/ void adjust_demand ( arena&, int delta ); which seems to end up waking (or launching) "delta" extra workers (unfortunately "delta" cannot be negative, as far as I understand, to facilitate implementing parallelism shrinkage). For the case where more parallelism is needed, would it be a "proper" solution to call this library routine from user code, or would it lead to unexpected behaviour?I'm afraid that blocking a thread may trap some work on the stack, with possibly "unwelcome" results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page