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

A functor at thread spawn?

Brownsword__Andrew
251 Views

It would be handy to be able to set a functor that gets invoked near the top of a newly spawned TBB worker thread.  There are some things that I would like to do when TBB starts a worker thread.  These are mostly for debugging related tasks, but don't just want to have it available in debug build.  Some examples are to initialize a bit of thread local storage, track thread ids, set thread names (on linux, at least) and so forth.

Is there any existing mechanism to do this?  Could one be added, if not?

 

0 Kudos
0 Replies
Reply