Re: Microsecond-based timeouts - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Microsecond-based timeouts
Date
Msg-id 20230313215919.vqcjb3obgktroyxy@awork3.anarazel.de
Whole thread Raw
In response to Microsecond-based timeouts  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
Hi,

On 2023-03-13 18:23:02 +1300, Thomas Munro wrote:
> One question is whether it'd be better to use nanoseconds instead,
> since the relevant high-resolution primitives use those under the
> covers (struct timespec).  On the other hand, microseconds are a good
> match for our TimestampTz which is the ultimate source of many of our
> timeout decisions.

It's hard to believe we'll need nanosecond sleeps anytime soon, given that
even very trivial syscalls take on the order of 100ns.

It's not like we couldn't add another function for waiting for nanoseconds at
a later point.


> I suppose we could also consider an interface with an absolute timeout
> instead, and then stop thinking about the units so much.

That seesm pretty awful to use, and we'd just end up with the same question at
the callsites.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: "Regina Obe"
Date:
Subject: RE: Ability to reference other extensions by schema in extension scripts
Next
From: Andres Freund
Date:
Subject: Re: windows CI failing PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED