Thread primitives – Comtrol eCos User Manual
Page 95

Kernel Real-time Characterization
numerical value. A higher priority thread will run in preference to a lower priority thread even though the priority
value of the higher priority thread may be numerically less than that of the lower priority thread.
Thread Primitives
Create thread
This test measures the
cyg_thread_create()
call. Each call creates a totally new thread. The set of threads
created by this test will be reused in the subsequent thread primitive tests.
Yield thread
This test measures the
cyg_thread_yield()
call. For this test, there are no other runnable threads, thus the
test should just measure the overhead of trying to give up the CPU.
Suspend [suspended] thread
This test measures the
cyg_thread_suspend()
call. A thread may be suspended multiple times; each thread
is already suspended from its initial creation, and is suspended again.
Resume thread
This test measures the
cyg_thread_resume()
call. All of the threads have a suspend count of 2, thus this
call does not make them runnable. This test just measures the overhead of resuming a thread.
Set priority
This test measures the
cyg_thread_set_priority()
call. Each thread, currently suspended, has its priority
set to a new value.
Get priority
This test measures the
cyg_thread_get_priority()
call.
Kill [suspended] thread
This test measures the
cyg_thread_kill()
call. Each thread in the set is killed. All threads are known to be
suspended before being killed.
Yield [no other] thread
This
test
measures
the
cyg_thread_yield()
call
again.
This
is
to
demonstrate
that
the
cyg_thread_yield()
call has a fixed overhead, regardless of whether there are other threads in the system.
Resume [suspended low priority] thread
This test measures the
cyg_thread_resume()
call again. In this case, the thread being resumed is lower
priority than the main thread, thus it will simply become ready to run but not be granted the CPU. This test
measures the cost of making a thread ready to run.
Resume [runnable low priority] thread
This test measures the
cyg_thread_resume()
call again. In this case, the thread being resumed is lower
priority than the main thread and has already been made runnable, so in fact the resume call has no effect.
95