librealtime
1.2
Extreamely easy to use realtime and policy thread
|
This library's target is support to use real-time processing which is needed robotics and system control field.
This library allows you to make strict periodic tasks and the tasks with priority without difficult Linux kernel and POSIX API knowledge
You can use librealtime library like std::thread library. So, you can start to use librealtime quickly.
librealtime library works only on Linux. Windows does NOT supported.
Web API documentation is HERE
Name | Discription | Scheduling |
---|---|---|
RealtimeThread | A real-time periodic thread | SCHED_DEADLINE |
PolicyThread | A std::thread added priority | SCHED_FIFO |
Please open with web browser(firefox, chrome and so on).
If you want to build the API documentation, type following commands.
When this program is run, "1234" x 30 should be output.
More samples can be found in example directory. In order build, type following commands.
You can start to try librealtime in 30 seconds!
Because librealtime is a header only library, you Do NOT need to build.
What's happen if realtime thread is made with PolicyThread? In other words, What's difference between RealtimeThread and PolicyThread?
Ok, Let's conduct a experiment!
Two program are made for experiment. you can find those programs in librealtime/example/testRealtimeThread.cpp, PolicyThread_e.cpp Those program tries to call a function 1000 times in 1 second. One program has a thread which is made by RealtimeThread, Another program has a thread which is made by PolicyThread and timer which wakes up every 1/1000 sec.
In short, environment of experiment is as below.
The results are as below.
Thread | Average | Standerd deviation | Counts |
---|---|---|---|
RealtimeThread | 1000129.986[nano sec] | 1452.211[nano sec] | 1000/1000 times |
PolicyThread | 1060530.358[nano sec] | 12778.745[nano sec] | 944/1000 times |
NOTE RealtimeThread occupy a core. If you use three RealtimeThread, three cores can not be used with other task. PolicyThread does not occupy a core.