initialization - In TBB, is there a way to find out if there is an existing task scheduler? -


in threading building blocks (tbb), if initialize 2 task schedulers within same scope, argument of second initialization ignored unless argument of first initialization deferred. in order avoid conflicts, find out if task scheduler has been initialized earlier in program. there way it? if so, argument that?

you may want consider tbb::this_task_arena::current_thread_index() , tbb::this_task_arena::max_concurrency() functions.

the tbb::this_task_arena::current_thread_index() function returns "tbb::task_arena::not_initialized if thread has not yet initialized task scheduler." (documentation link).

if task scheduler initialized can obtain requested number of threads tbb::this_task_arena::max_concurrency() function. however, cannot stack size used during previous task scheduler initialization.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -