multithreading - Context switches of thread (C++ windows) -


this question has answer here:

how can know "context switches" count c++, if know handle of thread? enter image description here

http://i.stack.imgur.com/myda2.jpg

  1. by querying perofrmance counters named thread(<process-name>/<thread-number>)/context switches/sec using 1 of apis, e.g. accessing performance data in c++. more on this: how programmatically count context switches?

  2. using windows internal ntquerysysteminformation api, see obtaining number of thread context switches programmatically details/code snippet.

talking process explorer in particular, guess it's taking data ntquerysysteminformation.


Comments