How to completely switch off threading in TBB code
问题 Note: this is NOT a duplicate of this quesiton. Given a complex software parallelized with TBB, how do I completely switch off threading? I'm aware of the task_scheduler_init: int nthreads = tbb::task_scheduler_init::default_num_threads(); const char* cnthreads = getenv("TBB_NUM_THREADS"); if (cnthreads) nthreads = std::max(1, atoi(cnthreads)); tbb::task_arena arena(nthreads, 1); tbb::task_scheduler_init init(nthreads); However, this solution (related to this) does not switch off threading.