Add full epicsTime from/to UTC struct tm conversion
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:
Related branches
- Andrew Johnson: Approve
-
Diff: 186 lines (+104/-9)3 files modifiedsrc/libCom/osi/epicsTime.cpp (+87/-6)
src/libCom/osi/epicsTime.h (+11/-2)
src/libCom/test/epicsTimeTest.cpp (+6/-1)