Improve spinlock code for recent x86 processors: insert a PAUSE

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f8eed65dfb580f0971e2e6ead83135bfa3ddeb06
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2003-12-27T20:58:58Z
Releases: 8.0.0
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

PathChange+/−
src/backend/storage/lmgr/s_lock.c modified +5 −1
src/include/storage/s_lock.h modified +22 −1