Discussion:
[Rtai] consistency of real time clock in user space
ChenPeng
2018-06-21 01:11:57 UTC
Permalink
Hi, everyone
I am using RTAI to develop some periodic procedure with rtai 3.4.9 and a kernel 3.4.55 on i386 platform.
In user space, I make a thread periodic and hard real time via rt_task_make_periodic and rt_make_hard_real_time,
However, I found that the time get by rt_get_time_ns in thread loop function is not consistent with the time get by rt_get_time_ns in a sub-function call:
during one 4ms period, the difference between the results returned by rt_get_time_ns differs about 30 ms, while the thread is scheduled with an jitter less than 40 us.
the call routine of the process is as following:
***************************************************************************************************************************************************************************
threadfunction Afunction B
loop_time=rt_get_time_ns();
function A();---------------------->
function B()------------------->
running_time=rt_get_time_ns();
return;
<-------------------
DO SOME THING...
return;
<-----------------------
DO SOME THING...
rt_wait_period();
***************************************************************************************************************************************************************************
So, can I be suspicious of the inconsistency of the time result ?
I wonder how can this happen? Is there a safe way to get the unique global consistent RT system time?


yours: Kira
2018-06-21

Loading...