Back to home page

LXR

 
 

    


Warning, /testsuites/rhealstone/rhtaskswitch/rhtaskswitch.adoc is written in an unsupported language. File is not indexed.

0001 == Task Switch Benchmark
0002 
0003 This benchmark measures the average time it takes the system to switch between
0004 two independent and active tasks of equal priority. Task switching is synchronous
0005 and non-preemptive.
0006 
0007 === Directives
0008 
0009   * rtems_task_wake_after
0010 
0011 
0012 === Methodology
0013 
0014 This benchmark utilizes rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ) to
0015 achieve a synchronous, non-preemptive task switch. rtems_task_wake_after
0016 used in this context is essentially just a yield.
0017 
0018 As this is an average, we structure the benchmark code in a way that results
0019 in some overhead being included that inflates the total elapsed time. This
0020 overhead includes:
0021   * the time it takes to iterate through the for loops (minimal
0022   * overhead code in rtems_task_wake_after
0023 
0024 We instantiate two tasks, and time how long it takes for them to switch back
0025 and forth between themselves a total of BENCHMARKS * 2 times. We then use
0026 the put_time call to divide this total elapsed time by BENCHMARKS * 2, giving
0027 an average, and subtract out the overhead time we found earlier.