Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Multiple pipelines

priya_0401
Beginner
200 Views

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?

Regards,

Priya

0 Kudos
1 Reply
Andrey_Marochko
New Contributor III
200 Views
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.

Reply