Re: Cleaning up historical portability baggage - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Cleaning up historical portability baggage
Date
Msg-id 295419.1659918447@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cleaning up historical portability baggage  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Cleaning up historical portability baggage
List pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> On Thu, Aug 4, 2022 at 4:09 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> clock_gettime is required by SUSv2 (1997), so I have to admit that
>> macOS 10.4 doesn't have a lot of excuse not to have it.  In any case,
>> prairiedog is just sitting there doing its thing until I find cycles
>> to install a newer OS.  If you want to move ahead with this, don't
>> let prairiedog block you.

> Thanks, will do.

BTW, that commit really should have updated the explanation at the top of
instr_time.h:

 * This file provides an abstraction layer to hide portability issues in
 * interval timing.  On Unix we use clock_gettime() if available, else
 * gettimeofday().  On Windows, gettimeofday() gives a low-precision result
 * so we must use QueryPerformanceCounter() instead.  These macros also give
 * some breathing room to use other high-precision-timing APIs.

Updating the second sentence is easy enough, but as for the third,
I wonder if it's still true in view of 24c3ce8f1.  Should we revisit
whether to use gettimeofday vs. QueryPerformanceCounter?  At the very
least I suspect it's no longer about "low precision", but about which
API is faster.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: logical decoding and replication of sequences
Next
From: Dong Wook Lee
Date:
Subject: old_snapshot: add test for coverage