Improve spinlock code for recent x86 processors: insert a PAUSE
Tom Lane <tgl@sss.pgh.pa.us>
Improve spinlock code for recent x86 processors: insert a PAUSE instruction in the s_lock() wait loop, and use test before test-and-set in TAS() macro to avoid unnecessary bus traffic. Patch from Manfred Spraul, reworked a bit by Tom.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/lmgr/s_lock.c | modified | +5 −1 |
| src/include/storage/s_lock.h | modified | +22 −1 |