How to estimate the thread context switching overhead?

Posted by Ignas Limanauskas on Stack Overflow See other posts from Stack Overflow or by Ignas Limanauskas
Published on 2008-11-20T09:21:23Z Indexed on 2010/05/15 14:54 UTC
Read the original article Hit count: 312

Filed under:
|
|
|

I am trying to improve the performance of the threaded application with real-time deadlines. It is running on Windows Mobile and written in C / C++. I have a suspicion that high frequency of thread switching might be causing tangible overhead, but can neither prove it or disprove it. As everybody knows, lack of proof is not a proof of opposite :).

Thus my question is twofold:

  • If exists at all, where can I find any actual measurements of the cost of switching thread context?

  • Without spending time writing a test application, what are the ways to estimate the thread switching overhead in the existing application?

  • Does anyone know a way to find out the number of context switches (on / off) for a given thread?

© Stack Overflow or respective owner

Related posts about windows-mobile

Related posts about multithreading