Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15694

Windows : use GetSystemTimePreciseAsFileTime if available for high resolution time

    XMLWordPrintable

    Details

    • Sprint:
      10.3.6-1

      Description

      Currently, we're using GetSystemTimesFileTime for high resolution timers.
      Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.

      For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
      prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
      downlevel Windows.

      Note: there is a higher cost associated with precise function. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .

        Attachments

          Activity

            People

            Assignee:
            wlad Vladislav Vaintroub
            Reporter:
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: