- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I call task::spawn does It mean that some other thread can execute this just spawned task before I spawn any other sibling task? If not when tasks become eligible for execution?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm confused by an advice given on page 168 of Thread Building Blocks book. It says "Allocate all siblings before of them starat to run, unless you are using allocate_additional_child_of". How shold I understend it? And how to acheive it. tbb does not allow to control when tasks starts running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - andreyryabov
I'm confused by an advice given on page 168 of Thread Building Blocks book. It says "Allocate all siblings before of them starat to run, unless you are using allocate_additional_child_of". How shold I understend it? And how to acheive it. tbb does not allow to control when tasks starts running.
As soon as you spawn a task you have no control over when it starts running, so you might just assume it already runs, or even finished.
That advice in the book, however, is too strong. Actually you can mix task allocation and spawns, as long as you appropriately set the reference counter before spawning any sibling task. Read the TBB Reference document, chapter 8.8 "Catalog of Recommended Task Patterns" for more detailed information of how the TBBtasks are supposed to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Alexey Kukanov (Intel)
As soon as you spawn a task you have no control over when it starts running, so you might just assume it already runs, or even finished.
That advice in the book, however, is too strong. Actually you can mix task allocation and spawns, as long as you appropriately set the reference counter before spawning any sibling task. Read the TBB Reference document, chapter 8.8 "Catalog of Recommended Task Patterns" for more detailed information of how the TBBtasks are supposed to use.
Great!
Thank you!
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