Re: atomic reads & writes (with no barriers)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: atomic reads & writes (with no barriers)
Date: 2015-12-04 16:08:42
Message-ID: 20151204160842.GA4934@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2015-12-03 16:10:51 -0600, Kevin Grittner wrote:
> Is the c.h change above on anything resembling the right track for
> a patch for this? If not, what would such a patch look like?

I think a better path would be to add fallback support for 64bit atomics
- like we already have for 32bit. That should really only take a few
lines. Then you can use pg_atomic_read_u64/pg_atomic_write_u64 and all
the rest of the atomics api.

For that to be helpful we'd want a more efficient read/write
implementation for some platforms (falls back to compare/exchange right
now), but that's easy.

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-12-04 16:09:11 Random crud left behind by aborted TAP tests
Previous Message Catalin Iacob 2015-12-04 16:08:21 Re: proposal: multiple psql option -c