summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Munro2023-03-15 03:14:36 +0000
committerThomas Munro2023-03-15 04:23:02 +0000
commite4da2a44c17a36904d4d083f9a96e90041d28f76 (patch)
tree53b3a9f57fccb29c4da3248f1ff48470d908c668
parent805b821e77a3a7d8d7827711e82e87c7bf61c681 (diff)
Update obsolete comment about pg_usleep() accuracy.
There are still some systems that use traditional tick-based sleep timing, but many including Linux, FreeBSD and macOS started using high resolution timer hardware more directly a decade or two ago. Update our comment about that. Also highlight that Windows is like the older Unixen in that respect. Author: Nathan Bossart <[email protected]> Discussion: https://postgr.es/m/CA%2BhUKG%2BogAon8_V223Ldv6taPR2uKH3X_UJ_A7LJAf3-VRARPA%40mail.gmail.com
-rw-r--r--src/port/pgsleep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/port/pgsleep.c b/src/port/pgsleep.c
index 8a709cd01d..b34efeae8c 100644
--- a/src/port/pgsleep.c
+++ b/src/port/pgsleep.c
@@ -25,9 +25,10 @@
/*
* pg_usleep --- delay the specified number of microseconds.
*
- * NOTE: although the delay is specified in microseconds, the effective
- * resolution is only 1/HZ, or 10 milliseconds, on most Unixen. Expect
- * the requested delay to be rounded up to the next resolution boundary.
+ * NOTE: Although the delay is specified in microseconds, older Unixen and
+ * Windows use periodic kernel ticks to wake up, which might increase the delay
+ * time significantly. We've observed delay increases as large as 20
+ * milliseconds on supported platforms.
*
* On machines where "long" is 32 bits, the maximum delay is ~2000 seconds.
*