Scheduler primitives – Comtrol eCos User Manual

Page 96

Advertising
background image

Kernel Real-time Characterization

Suspend [runnable] thread

This test measures the

cyg_thread_suspend()

call again. In this case, each thread has already been made

runnable (by previous tests).

Yield [only low priority] thread

This test measures the

cyg_thread_yield()

call. In this case, there are many other runnable threads, but

they are all lower priority than the main thread, thus no thread switches will take place.

Suspend [runnable->not runnable] thread

This test measures the

cyg_thread_suspend()

call again. The thread being suspended will become non-

runnable by this action.

Kill [runnable] thread

This test measures the

cyg_thread_kill()

call again. In this case, the thread being killed is currently

runnable, but lower priority than the main thread.

Resume [high priority] thread

This test measures the

cyg_thread_resume()

call. The thread being resumed is higher priority than the

main thread, thus a thread switch will take place on each call. In fact there will be two thread switches; one to
the new higher priority thread and a second back to the test thread. The test thread exits immediately.

Thread switch

This test attempts to measure the cost of switching from one thread to another. Two equal priority threads are
started and they will each yield to the other for a number of iterations. A time stamp is gathered in one thread
before the

cyg_thread_yield()

call and after the call in the other thread.

Scheduler Primitives

Scheduler lock

This test measures the

cyg_scheduler_lock()

call.

Scheduler unlock [0 threads]

This test measures the

cyg_scheduler_unlock()

call. There are no other threads in the system and the

unlock happens immediately after a lock so there will be no pending DSR’s to run.

Scheduler unlock [1 suspended thread]

This test measures the

cyg_scheduler_unlock()

call. There is one other thread in the system which is

currently suspended.

Scheduler unlock [many suspended threads]

This test measures the

cyg_scheduler_unlock()

call. There are many other threads in the system which

are currently suspended. The purpose of this test is to determine the cost of having additional threads in the
system when the scheduler is activated by way of

cyg_scheduler_unlock()

.

96

Advertising