Use condition variables to wait for checkpoints.
Thomas Munro <tmunro@postgresql.org>
Use condition variables to wait for checkpoints. Previously we used a polling/sleeping loop to wait for checkpoints to begin and end, which leads to up to a couple hundred milliseconds of needless thumb-twiddling. Use condition variables instead. Author: Thomas Munro Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CA%2BhUKGLY7sDe%2Bbg1K%3DbnEzOofGoo4bJHYh9%2BcDCXJepb6DQmLw%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +9 −1 |
| src/backend/postmaster/checkpointer.c | modified | +17 −4 |
| src/backend/postmaster/pgstat.c | modified | +6 −0 |
| src/include/pgstat.h | modified | +2 −0 |
Documentation touched
Discussion
- Using condition variables to wait for checkpoints 5 messages · 2019-03-12 → 2019-04-05