contextswitch
contextswitch copied to clipboard
Incorrect switch count in timectxsw.c
Hi tsuna,
In your timectxsw.c benchmark, the variable nswitches is not correct.
It should be: const int nswitches = iterations * 6;
and not: const int nswitches = iterations << 2;
If you follow through the child and parent for loops you will see there are 6 context switches per iteration.
Many thanks for a really useful bit of code.
Christo