RTEMS Logo

RTEMS 4.6.1 On-Line Library


CPU386 Timing Data Context Switch

PREV UP NEXT Bookshelf RTEMS Intel i386 Applications Supplement

10.4: Context Switch

The RTEMS processor context switch time is 34 microseconds on the Force Computers CPU386 benchmark platform. This time represents the raw context switch time with no user extensions configured. Additional execution time is required when a TASK_SWITCH user extension is configured. The use of the TASK_SWITCH extension is application dependent. Thus, its execution time is not considered part of the base context switch time.

Since RTEMS was designed specifically for embedded missile applications which are floating point intensive, the executive is optimized to avoid unnecessarily saving and restoring the state of the numeric coprocessor. The state of the numeric coprocessor is only saved when a FLOATING_POINT task is dispatched and that task was not the last task to utilize the coprocessor. In a system with only one FLOATING_POINT task, the state of the numeric coprocessor will never be saved or restored. When the first FLOATING_POINT task is dispatched, RTEMS does not need to save the current state of the numeric coprocessor.

The exact amount of time required to save and restore floating point context is dependent on the state of the numeric coprocessor. RTEMS places the coprocessor in the initialized state when a task is started or restarted. Once the task has utilized the coprocessor, it is in the idle state when floating point instructions are not executing and the busy state when floating point instructions are executing. The state of the coprocessor is task specific.

The following table summarizes the context switch times for the Force Computers CPU386 benchmark platform:

No Floating Point Contexts 34
Floating Point Contexts
restore first FP task
57
save initialized, restore initialized
59
save idle, restore initialized
59
save idle, restore idle
83


PREV UP NEXT Bookshelf RTEMS Intel i386 Applications Supplement

Copyright © 1988-2004 OAR Corporation