aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-06-28 12:30:55 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-06-28 12:39:55 +0300
commit9e0bc7c1e84d7fffb93130f2b7d079a0853329ed (patch)
treea1689d931865c74bed16eb431a7606d86acb83fc /src/backend/tcop/postgres.c
parent9db4ad44eb02326bbe8eeaf7d1dd452844764a20 (diff)
downloadpostgresql-9e0bc7c1e84d7fffb93130f2b7d079a0853329ed.tar.gz
postgresql-9e0bc7c1e84d7fffb93130f2b7d079a0853329ed.zip
Track spinlock delay in microsecond granularity.
On many platforms the OS will round the sleep time to millisecond resolution, but there is no reason for us to pre-emptively round the argument to pg_usleep. When the delay was measured in milliseconds and started from 1 ms, it sometimes took many attempts until the logic that increases the delay by multiplying with a random value between 1 and 2 actually managed to bump it from 1 ms to 2 ms. That lead to a sequence of 1 ms waits until the delay started to increase. This wasn't really a problem but it looked odd if you observed the waits. There is no measurable difference in performance, but it's more readable this way. Jeff Janes
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions