teunis wrote:
> And if anyone has any ideas on how to profile a multithreaded app, let me
> know :)

Well, take care to store your profiling information _inside_ memory,
and output them to disk or terminal all in a bunch (preferably at the
final end of the program). If you are on a uniprocessor, record the
state of both threads (even the sleeping one).

Then, process this output with a specific program, e.g. to compute
the amount of parallelism that you obtained: the ratio of the
accumulated time during which both (several) threads were runnable
against the overall execution time of the program.
That's a rather good indicator. (If you are over 0.2, it is worth
the work.)

Of course, mean values are not so meaningfull but, if you can obtain
this result, it will already be very nice (don't forget to AVOID
introducing shared ressources artificially due to the profiling
code, such as the access to an IO buffer, or a terminal :-). IIRC,
GNU Nana had very nice things for this, but I am not sure if it
is threadsafe.... maybe you could check that (see on gnu.org).


Reply via email to