Rough workflow of my code -
-Each thread is in a continuous while loop - persistent thread
-There is a global worklist - threads read work units from this worklist - process them - may or maynot add new work back to the worklist.
- This producer-consumer cycle goes on till there is no work in the list AND all threads are also idle (this is the convergence/exit condition)
Now, there are times when threads/thread blocks are waiting for other threads to produce some work (other threads are busy working)
I wish to time-stamp this wait - or in some way know for how much time a thread had to wait before new work was added to the list and It was able to read that new work.
Are there any suggestions for this?
Basically I wanna have my own timing function through which i can time such waits in the kernel.
Thanks
Sid.