Semaphore primitives – Comtrol eCos User Manual

Page 99

Advertising
background image

Kernel Real-time Characterization

Peek item [empty] mbox

This test measures the

cyg_mbox_peek_item()

call. An attempt is made to fetch an item from a mailbox

that is empty. The purpose of this test is to measure the cost of trying to obtain an item when the mailbox is
empty.

Tryget [empty] mbox

This test measures the

cyg_mbox_tryget()

call. An attempt is made to fetch an item from a mailbox that is

empty. The purpose of this test is to measure the cost of trying to obtain an item when the mailbox is empty.

Waiting to get mbox

This test measures the

cyg_mbox_waiting_to_get()

call. The purpose of this test is to measure the cost of

determining how many threads are waiting to obtain a message from this mailbox.

Waiting to put mbox

This test measures the

cyg_mbox_waiting_to_put()

call. The purpose of this test is to measure the cost of

determining how many threads are waiting to put a message into this mailbox.

Delete mbox

This test measures the

cyg_mbox_delete()

call. The purpose of this test is to measure the cost of destroying

a mailbox and removing it from the system.

Put/Get mbox

In this round-trip test, one thread is sending data to a mailbox that is being consumed by another thread. The
time from when the data is put into the mailbox until it has been delivered to the waiting thread is measured.
Note that this time will contain a thread switch.

Semaphore Primitives

Init semaphore

This test measures the

cyg_semaphore_init()

call. A number of separate semaphore objects are created

and introduced to the system. The purpose of this test is to measure the cost of creating a new semaphore.

Post [0] semaphore

This test measures the

cyg_semaphore_post()

call. Each semaphore currently has a value of 0 and there

are no other threads in the system. The purpose of this test is to measure the overhead cost of posting to a
semaphore. This cost will differ if there is a thread waiting for the semaphore.

Wait [1] semaphore

This test measures the

cyg_semaphore_wait()

call. The semaphore has a current value of 1 so the call is

non-blocking. The purpose of the test is to measure the overhead of “taking” a semaphore.

Trywait [0] semaphore

This test measures the

cyg_semaphore_trywait()

call. The semaphore has a value of 0 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 no.

99

Advertising