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

measuring idle time of worker threads

Geoffrey_Irving
Beginner
244 Views
I have a threaded application with timing blocks around all the sections of code I *believe* are performance intensive.  These sections are long enough that the timing code can remain active even in final production runs.

In my current custom implementation of a thread pool, I compute two extra times for each worker thread: (1) the amount of idle time spent waiting on an empty pool for a job to arrive and (2) the amount of "missing" time not accounted for by either idling or a timing block (indicating a performance intensive region that I've missed).

Is it possible to measure idle time when using TBB tasks?  The sum of idle time and missing time can easily be computed by subtracting each timed section from the total wall clock interval, but getting at each separately requires special support (or perhaps a special idle task with low priority that spins trying to preempt itself?).
0 Kudos
1 Reply
Geoffrey_Irving
Beginner
244 Views
I asked this question at http://stackoverflow.com/questions/11926270/measuring-thread-idle-time-with-tbb as well, and will synchronize answers.
0 Kudos
Reply