On Sun, Feb 26, 2012 at 6:16 AM, Jayashankar K B
<Jayashankar.KB@lnties.com> wrote:
> Ok. I did a manual patch and it Postgres 9.1.1 compiled for me without using the --disable-spinlocks option.
> Thanks a lot for the patch. :)
> By the way, could you please point me to the explanation on the significance of spinlocks for Postgres?
spinlocks are used all over the place to synchronize access to shared
data structures (see here: http://en.wikipedia.org/wiki/Spinlock also
see here: http://rhaas.blogspot.com/2011/01/locking-in-postgresql.html).
you can awkwardly implement them in high level languages like C but
typically there are hardware primitives that are much faster and
better to use.
very generally speaking, spinlocks are a better than semaphores when
the lock duration is very short, contention isn't terrible, and the
time taken to acquire the lock matters.
merlin