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

How to reset number_of_threads

coolhelix
Beginner
359 Views

Hi, guys,

One of SDK, which I use, initialized the tbb internally at its startup.

I wan to reset the number of threads of TBB to a large value.

But tbb::task_scheduler_init::initialize( int number_of_threads) can't help me do this update.

Is there any other way to do it?

Thanks!


0 Kudos
3 Replies
RafSchietekat
Valued Contributor III
359 Views
Why? (rhetorical question, too short to post by tself)
0 Kudos
coolhelix
Beginner
359 Views
I want to create some tasks which live in whole process life time, and they can execute concurrently.
If I didn't enlarge the thread count, one task is holding all the time until the other task execution exit.

_TBB_Yield() could help on this?

Thanks!
0 Kudos
RafSchietekat
Valued Contributor III
359 Views
I don't know what you plan to do with those, but you should probably use tbb_thread instead. Tasks are suitable (but then also preferable) only for finite amounts of CPU-bound work without required concurrency (the program should also work with a single thread).

Don't use __TBB_Yield() in your programs.
0 Kudos
Reply