IPCLatency Sample
Source files for measuring the latency for switching between two threads.
Source Files
| File | Description |
|---|---|
IPCLatency.c
|
The main source file. |
Building the Sample
Build the sample in any of the four available configurations: Debug, Release (to build IPCLatency.exe) or RTSSDebug, RTSSRelease (to build IPCLatency.rtss).
Running the Sample
Start the Subsystem through wRTOS Settings or wRTOS Control Panel, and then run this command:
RTSSrun IPCLatency.rtss [options]
Options
|
Option |
Description |
Default |
|---|---|---|
|
-t <num> |
Trip method:
|
1 |
|
-i <num> |
Outer loop count (test rounds) |
1000 |
|
-j <num> |
Inner loop count (iterations per round) |
10000 |
|
-d <num> |
Delay between outer loops (ms) |
30 |
|
-m <num> |
Pentium speed estimate (for ns conversion) |
200 |
Expected Results
- A PASS or FAIL status
- PASS: Threads alternate correctly and complete all iterations.
- FAIL: Thread counters were out of sync.
- A minimum, maximum, and average latency (in ns)
- The number of samples
- A histogram of latencies
- (If under RTSS) A timing breakdown with and without timer interrupt
Remarks
- Use different
-tvalues to test various thread-switch mechanisms. - For baseline measurement, use
-t 6(No Trip) or-t 7(Release Semaphore). - Histogram resolution is controlled by the RESOLUTION and NBUCKETS macros.
APIs Referenced
|
RTAPI |
|---|