Re: Sync Rep v17 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Sync Rep v17
Date
Msg-id 16564.1298992553@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sync Rep v17  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Mar 1, 2011 at 3:21 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> LWlocks are just spinlocks plus sem sleeps, so I don't see the need for
>> that in the current code. Other views welcome.

> An LWLock is a lot safer, in general, than a spinlock.  A spinlock
> mustn't do anything that could emit an error or abort (among other
> things).  I doubt that the performance cost of using an LWLock rather
> than a spin lock here is enough to matter, and the spin lock seems
> more likely to result in hard-to-find bugs.

Well, stuck spinlocks aren't exactly hard to identify.  But I agree that
the lack of any release-on-error infrastructure is a killer reason not
to use a spinlock for anything but short straight-line code segments.
        regards, tom lane


pgsql-hackers by date:

Previous
From: hom
Date:
Subject: error order when debug postgresql step by step?
Next
From: "Kevin Grittner"
Date:
Subject: Re: error order when debug postgresql step by step?