Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Geoffrey_Irving
Beginner
66 Views

measuring idle time of worker threads

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
66 Views

I asked this question at http://stackoverflow.com/questions/11926270/measuring-thread-idle-time-with-tbb as well, and will synchronize answers.
Reply