A newbie question regarding parallel_while knockoff and tbb::task::self()

Raf Schietekat
Total Points:
16,805
Status Points:
16,805
Black Belt
July 12, 2009 11:11 AM PDT
Rate
 
#1
Reference (Open Source).pdf revision 1.13 (may not be latest) says for task::self(): "If the calling thread is a user-created thread that is not running any task, self() returns a reference to an implicit dummy task associated with the thread." So if you want to call task::allocate_additional_child_of() from your own thread, make sure it has an active task_scheduler_init registration, and use task::self().

(Added) It does leave me wondering what this does for ownership, because the owner may go away or become unregistered during the lifetime of the task. What does ownership do besides affecting the outcome of is_stolen_task()?

Intel Software Network Forums Statistics

8487 users have contributed to 31622 threads and 100698 posts to date.
In the past 24 hours, we have 35 new thread(s) 121 new posts(s), and 186 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983