You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2013/03/25 23:47:16 UTC

[jira] [Commented] (TS-1775) Cleanup of ink_hrtime.{cc,h}

    [ https://issues.apache.org/jira/browse/TS-1775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13613253#comment-13613253 ] 

Leif Hedstrom commented on TS-1775:
-----------------------------------

Looking some more, it seems ink_get_based_hrtime_internal() is not only pointless (since we don't support USE_TIME_STAMP_COUNTER_HRTIME), it's also confusing in that on Linux, it'll end up using clock_gettime(). And it doesn't do the right thing at all on FreeBSD. I say we get rid of ink_get_based_hrtime_internal() completely, in favor of ink_get_hrtime_internal() and ink_get_hrtime() (for Thread's).
                
> Cleanup of ink_hrtime.{cc,h}
> ----------------------------
>
>                 Key: TS-1775
>                 URL: https://issues.apache.org/jira/browse/TS-1775
>             Project: Traffic Server
>          Issue Type: Improvement
>            Reporter: Leif Hedstrom
>
> A few things comes to mind:
> 1) Why do we have a NEED_HRTIME define? It's always on as far as I can tell, and I can't imagine there's a reason to not have it on (it'd completely break like everything, in fact it would fail to compile since gethrtime() doesn't exist?).
> 2) We should eliminate the USE_TIME_STAMP_COUNTER_HRTIME define, and the code that implements our own TSC code. Modern Unix flavors implements this already in various way (e.g. glibc's gettimeofday() wrapper has a TSC user space implementation).
> 3) On FreeBSD, jpeach points out that CLOCK_REALTIME is probably not the optimal way to use clock_gettime(). He suggest using CLOCK_REALTIME_FAST or CLOCK_MONOTONIC_FAST which is similar to the optimizations done with TSC for gettimeofday() on linux.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira