Nat! bio photo

Nat!

Senior Mull.

Twitter RSS

Github

Measuring context switches :: a small expedition. Part IV

The results are all similiar for the other CPUs/Cores except for CPU0, where it's deterministically different each time:

(27 -> 540) 0.002849s

18859 : 0
19009 : 0
19197 : 0
19306 : 0
19438 : 0
19444 : 0
19444 : 0
19600 : 0
19650 : 0
19765 : 0
19874 : 0
19903 : 0
19912 : 0
19941 : 0
19965 : 0
20441 : 0
20547 : 0
20617 : 0
20629 : 0
20880 : 0
21409 : 0
21862 : 0
23376 : 0

First thing to notice, the program only runs for 0.0028s. That means the frequency of context switches is much higher on CPU 0. 100 times higher in this case. The duration of each context switch is also longer, lets say the average is 20000 cycles making that about 7 times longer.