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

Process affinity and spawned tasks

andysem
New Contributor III
213 Views
Hi,
I have a question regarding recently added support for TBB thread number limitation in accordance with process affinity mask. IIUC, if the process is bound to a single core, TBB will not create any worker threads. If that is the case, will spawned tasks be ever executed? Note that in my case the main thread doesn't wait for the tasks to finish, it proceeds with other things. Instead, each task upon its completionreports back to the main thread through our private task scheduler, which runs in the main thread.
0 Kudos
1 Solution
RafSchietekat
Valued Contributor III
213 Views
If you enqueue, you don't have to wait, and at least one worker thread will be created even on a single-core system.

If you spawn, you will have to wait at some point, and ona single-core system your spawned tasks will only be executed at that time.

It seems like you want enqueue here.

View solution in original post

0 Kudos
1 Reply
RafSchietekat
Valued Contributor III
214 Views
If you enqueue, you don't have to wait, and at least one worker thread will be created even on a single-core system.

If you spawn, you will have to wait at some point, and ona single-core system your spawned tasks will only be executed at that time.

It seems like you want enqueue here.
0 Kudos
Reply