Community
cancel
Showing results for 
Search instead for 
Did you mean: 
andysem
New Contributor III
26 Views

Process affinity and spawned tasks

Jump to solution
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

Accepted Solutions
RafSchietekat
Black Belt
26 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

1 Reply
RafSchietekat
Black Belt
27 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