Re: Use gcc built-in atomic inc/dec in lock.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use gcc built-in atomic inc/dec in lock.c
Date: 2012-12-14 20:33:28
Message-ID: CA+TgmoZ1WOXZVFUWfaNE18Ynt1WApcxwzZAfbP4Wh+98xHtMVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 12, 2012 at 5:19 PM, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> On 12 December 2012 22:11, Mikko Tiihonen
> <mikko(dot)tiihonen(at)nitorcreations(dot)com> wrote:
>> noticed a "XXX: It might be worth considering using an atomic fetch-and-add
>> instruction here, on architectures where that is supported." in lock.c
>>
>> Here is my first try at using it.
>
> That's interesting, but I have to wonder if there is any evidence that
> this *is* actually helpful to performance.

Ditto. I've had at least one bad experience with an attempted change
to this sort of thing backfiring. And it's possible that's because my
implementation sucked, but the only concrete evidence of that which I
was able to discern was bad performance. So I've learned to be
skeptical of these kinds of things unless there are clear benchmark
results.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-12-14 20:39:44 Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors
Previous Message Andrew Dunstan 2012-12-14 20:32:16 Re: Assert for frontend programs?