[Ace-users] Reg profiling ace application with multiple tasks

sunil sunilsreenivas2001 at yahoo.com
Fri Dec 14 18:38:52 CST 2007


Hello,
        We have an application thats using multiple ACE_Tasks
(threads) each with their own queue. I want to print something like
what% of the time each of the threads are doing some work (%busy). A
simple way to get the time stamp in my svc method after coming out
wait state from getq()(t1) and get time before it enters getq again
(t2),
so it has took t2-t1 (assuming this is to milli seconds) precisions
(is there an ace timer with milli second pricesion?), add up these
over some observed time window (of say 10 seconds) and then
%utilization =
   sum/obintr *100.
 The only catch I can see here is that its possible that while thread
is processing its context switched by OS and so it doesnt really run
for t2-t1 but for time less than that.  This again depends on the
native thread library that ACE_Task is wrapping whether its M to N/N
to 1/1 to 1....
 Also if we are doing blocking I/O read/write given that we use
reactor, we are guaranteed to not block/include that time in
processing time is that correct....
Any ideas on this stuff?
Thank you,
Sunil


More information about the Ace-users mailing list