forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite09db94
committed
Use more of gcc's __sync_fetch_and_xxx builtin functions for atomic ops.
In addition to __sync_fetch_and_add, gcc offers __sync_fetch_and_sub,__sync_fetch_and_and, and __sync_fetch_and_or, which correspond directlyto primitive atomic ops that we want. Testing shows that in some casesthey generate better code than our generic implementations, so use them.We've assumed that configure's test for __sync_val_compare_and_swap issufficient to allow assuming that __sync_fetch_and_add is available, somake the same assumption for these functions. Should that prove to bewrong, we can add more configure tests.Yura Sokolov, reviewed by Jesper Pedersen and myselfDiscussion:https://postgr.es/m/7f65886daca545067f82bf2b463b218d@postgrespro.ru1 parente530be9 commite09db94
1 file changed
+58
-0
lines changedLines changed: 58 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
176 | 176 |
| |
177 | 177 |
| |
178 | 178 |
| |
| 179 | + | |
| 180 | + | |
179 | 181 |
| |
180 | 182 |
| |
181 | 183 |
| |
| |||
185 | 187 |
| |
186 | 188 |
| |
187 | 189 |
| |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
188 | 217 |
| |
189 | 218 |
| |
190 | 219 |
| |
| |||
214 | 243 |
| |
215 | 244 |
| |
216 | 245 |
| |
| 246 | + | |
| 247 | + | |
217 | 248 |
| |
218 | 249 |
| |
219 | 250 |
| |
| |||
223 | 254 |
| |
224 | 255 |
| |
225 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
226 | 284 |
| |
227 | 285 |
| |
228 | 286 |
|
0 commit comments
Comments
(0)