- Notifications
You must be signed in to change notification settings - Fork28
Commit9e0bc7c
committed
Track spinlock delay in microsecond granularity.
On many platforms the OS will round the sleep time to millisecondresolution, but there is no reason for us to pre-emptively round theargument to pg_usleep.When the delay was measured in milliseconds and started from 1 ms, itsometimes took many attempts until the logic that increases the delay bymultiplying with a random value between 1 and 2 actually managed to bump itfrom 1 ms to 2 ms. That lead to a sequence of 1 ms waits until the delaystarted to increase. This wasn't really a problem but it looked odd if youobserved the waits. There is no measurable difference in performance, butit's more readable this way.Jeff Janes1 parent9db4ad4 commit9e0bc7c
1 file changed
+6
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 84 | | |
90 | 85 | | |
91 | 86 | | |
92 | 87 | | |
93 | | - | |
94 | | - | |
| 88 | + | |
| 89 | + | |
95 | 90 | | |
96 | 91 | | |
97 | 92 | | |
| |||
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
112 | | - | |
| 107 | + | |
113 | 108 | | |
114 | | - | |
| 109 | + | |
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
| |||
122 | 117 | | |
123 | 118 | | |
124 | 119 | | |
125 | | - | |
126 | | - | |
| 120 | + | |
| 121 | + | |
127 | 122 | | |
128 | 123 | | |
129 | 124 | | |
| |||
0 commit comments
Comments
(0)