Counters, Alarms – Comtrol eCos User Manual
Page 100

Kernel Real-time Characterization
Trywait [1] semaphore
This test measures the
cyg_semaphore_trywait()
call. The semaphore has a value of 1 when the call is
made. The purpose of this test is to measure the cost of seeing if a semaphore can be “taken” without blocking.
In this case, the answer would be yes.
Peek semaphore
This test measures the
cyg_semaphore_peek()
call. The purpose of this test is to measure the cost of ob-
taining the current semaphore count value.
Destroy semaphore
This test measures the
cyg_semaphore_destroy()
call. The purpose of this test is to measure the cost of
deleting a semaphore from the system.
Post/Wait semaphore
In this round-trip test, two threads are passing control back and forth by using a semaphore. The time from
when one thread calls
cyg_semaphore_post()
until the other thread completes its
cyg_semaphore_wait()
is measured. Note that each iteration of this test will involve a thread switch.
Counters
Create counter
This test measures the
cyg_counter_create()
call. A number of separate counters are created. The purpose
of this test is to measure the cost of creating a new counter and introducing it to the system.
Get counter value
This test measures the
cyg_counter_current_value()
call. The current value of each counter is obtained.
Set counter value
This test measures the
cyg_counter_set_value()
call. Each counter is set to a new value.
Tick counter
This test measures the
cyg_counter_tick()
call. Each counter is “ticked” once.
Delete counter
This test measures the
cyg_counter_delete()
call. Each counter is deleted from the system. The purpose
of this test is to measure the cost of deleting a counter object.
Alarms
Create alarm
This test measures the
cyg_alarm_create()
call. A number of separate alarms are created, all attached to the
same counter object. The purpose of this test is to measure the cost of creating a new counter and introducing
it to the system.
100