04-28-2009 09:19 AM
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?
04-28-2009 09:38 AM
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.
04-28-2009 01:07 PM
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.