Does it make sense to change boost::asio::deadline_timer to steady_timer?

Heyi Guo guoheyi at linux.alibaba.com
Thu Mar 10 01:15:53 AEDT 2022


Hi all,

We can see lots of using boost::asio::deadline_timer in the code, like 
dbus-sensors. However, this timer is based on UTC clock and might be 
affected by system time. I tested and found the timer didn't trigger in 
time if I changed system time to some early time after starting the 
timer (calling expire_from_now()). And I think this situation might 
happen if system time of BMC is synchronized with host or NTP.

At the other hand, steady_timer is a chrono timer and should not be 
affected by system time.

Is there any reason to use deadline_timer for relative timer trigger? 
Shall we switch to steady_timer to avoid being affected by system time 
change?

Thanks,

Heyi



More information about the openbmc mailing list