0

Is there any way to analyze timing of context switch in multithread? While learning about multithread, I often see figures such as

this

enter image description here

this

enter image description here

or this

enter image description here

Is there any way to read and visualize the context switch timing during program execution so that I'm able to see for example : how many duration is spent on Task X before it switch into Task Y, then how many duration is spent on it before switched into Task X again, or if the duration is not calculable, how to get notification that says "Task X is stopped, switch to Task Y"

duck
  • 369
  • 3
  • 17
  • Which OS is this for? – Wyck Sep 04 '20 at 03:39
  • Im trying to analyze multithread performance in embedded system based on DebianJessie – duck Sep 04 '20 at 03:43
  • 1
    This might be better suited to Unix and Linux stack exchange site. Because there's certainly nothing available within the C++ language to observe those things, and no amount of instrumentation can accomplish this (the thread will be ambivalent about context switches) so it'll be an OS-specific thing to trace them. e.g. of answers over there: https://unix.stackexchange.com/questions/313424/record-time-of-every-process-or-thread-context-switch – Wyck Sep 04 '20 at 03:52

0 Answers0