[En-Nut-Discussion] Nut/OS measuring

Eric Haver havereric1 at gmail.com
Wed Apr 28 14:51:10 CEST 2010


On Wed, Apr 28, 2010 at 1:02 AM, janis vingris <janis.vingris88 at gmail.com>wrote:

> HI, my name is Janis and I working at my bachelor's degree work. It is
> about
> RTOS in real time systems. One point of my work is measuring RTOS, for this
> task I chose Nut/OS. In Nut/OS wiki FAQ page I was read that your
> calculation for context switch overhead is 115 cycles and interrupt
> overhead
> is 64 or 45 cycles. My question is, how you made these calculations and
> what
> mean cycles(I think it isn't timer ticks)?
> Thank you.
>

Yia Sou Janis,

The cycles mentioned here are processor clock cycles, that is, a processor
with a 20 MHz clock will take 2.5 times longer than a processor with a 50
MHz clock.   This calculation for context switching is probably made by
adding up the execution times of each assembly language instruction from
when context switch permission given by the running thread
(NutThreadYield()) to when of execution of the next thread resumes.

As for Interrupt Overhead, when an interrupt occurs, the RTOS must save what
is going on, and jump to your routine to handle it.  That execution takes
cycles and is called "overhead".

Find NutThreadSwitch() for your particular architecture to calculate that
yourself.

Have fun,

*E



More information about the En-Nut-Discussion mailing list