[MDEV-15694] Windows : use GetSystemTimePreciseAsFileTime if available for high resolution time Created: 2018-03-27  Updated: 2022-01-24  Resolved: 2018-04-02

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows
Fix Version/s: 10.3.6

Type: Task Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None

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 .


Generated at Thu Feb 08 08:23:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.