Multiple pipelines

Multiple pipelines

TBB pipeline FAQ says that multiple TBB pipelines can be run concurrently if they are launched from different TBB tasks or OS threads. I would like to clarify the meaning of OS threads: do you mean logical threads, as can be created by pthreads, say?



2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Exactly. Threads that are explicitly created by means of APIs like pthread_create, _beginthreadex, or CreateThread are usually referred to as OS threads. Another example of OS thread is the thread implicitly created for you by OS to run your main, or WinMain, or DllMain , or whatever else entry function of your application/module.

In general it is safe (from both correctness and performance standpoint) to run TBB's parallel algorithms from wherever you are, independently on whether other TBB algorithms has already been started from other threads. It is also safe to run one algorithm inside the other (nested parallelism). TBB efficiently handles all these usage models.

Leave a Comment

Please sign in to add a comment. Not a member? Join today