Re: [Windows,PATCH] Use faster, higher precision timer API - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [Windows,PATCH] Use faster, higher precision timer API
Date
Msg-id 541A5371.3030509@2ndquadrant.com
Whole thread Raw
In response to Re: [Windows,PATCH] Use faster, higher precision timer API  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 09/17/2014 11:19 PM, Andrew Dunstan wrote:
> 
> On 09/17/2014 08:27 AM, Craig Ringer wrote:
>> Hi all
>> On Windows 2012 and Windows 8 I'd like to use the new
>> GetSystemTimePreciseAsFileTime call instead. As this requires some extra
>> hoop-jumping to safely and efficiently use it without breaking support
>> for older platforms I suggest that we start with just switching over to
>> GetSystemTimeAsFileTime, which has been supported since Windows 2000.
>> Then more precise time capture can be added in a later patch.

> That will presumably breaK XP.

Yes, and Windows 7. But this patch doesn't to that, it just makes
adjustments that make it easier.

The next step is to use LoadLibrary and GetProcAddress to resolve
GetSystemTimePreciseAsFileTime *if it is available*, during backend
start. Then use it if possible, and fall back to GetSystemTimeAsFileTime
if it isn't.

This patch does not introduce any BC changes. At all. I should've
omitted all mention of the next step I want to take, but I thought it
was a useful explanation of why this change makes a bigger improvement
easier.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: proposal: plpgsql - Assert statement
Next
From: Craig Ringer
Date:
Subject: Re: [Windows,PATCH] Use faster, higher precision timer API