Well, that's at least a diagnostic hint, though not necessarily the most efficient thing to do in practice. If you are certain the lifetime of the task_scheduler_init object created in the constructorspansthat of theparentfunction call described above, then perhaps the parent function is being called from a different thread, one not registered with a task_scheduler_init object. Is your program already multi-threaded through some means besides TBB?
It might be more efficient to keep the task_scheduler_init object alive in your constructed object in addition to the one you added to the parent function. The function-level object should only bump a reference count rather than creating and destroying its own set of worker threads. Even better would be to instantiate an init object whose lifetime is from the first constructor call to the end of the program; trashing the thread pool every time your library object goes away may still be putting an unnecessary drag on the system.