Add full epicsTime from/to UTC struct tm conversion

Bug #1630256 reported by Ralph Lange
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Undecided
Ralph Lange
3.14
Fix Released
High
Ralph Lange
3.15
Fix Released
High
Ralph Lange
3.16
Fix Released
Undecided
Ralph Lange

Bug Description

We recently ran into an issue that others might have experienced before: [1]

Calling time functions that honour timezones - e.g. mktime() or localtime() - causes filesystem reads when accessing the timezone information. In setups where these functions are being called from driver threads in possibly fast loops (in our case converting time stamps from incoming PLC data packets) this easily leads to congestion and jitter in the 10s of millisecond range. (Connecting an IOC to 10 PLCs with fast updates caused the system to completely overload and come close to a standstill, with TCP buffers overflowing and constant 350% CPU utilization on a 4 core VM.)

In libCom/osi's epicsTime module, I see epicsTimeToTM() and epicsTimeToGMTM() methods that allow to select if the timezone mechanism should be used or not.

However, the other direction only offers epicsTimeFromTM() that honors timezones, and eventually calls mktime().

epicsTimeFromGMTM() and the matching epicsTime::epicsTime(const gm_tm_nano_sec &tm) should be added.

Tags: libcom

Related branches

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.