Re: Status of 64 bit atomics

From: Arthur Silva <arthurprs(at)gmail(dot)com>
To: John Gorman <johngorman2(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Status of 64 bit atomics
Date: 2016-05-27 20:00:20
Message-ID: CAO_YK0XSEu8-zcQgYDyvUgtOi1i6QzW_+uqFv1rRtAQHOJUxOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 27, 2016 5:01 PM, "John Gorman" <johngorman2(at)gmail(dot)com> wrote:
>
> Hi All
>
> Someone recently told me that the postgresql atomics library was
incomplete
> for 64 bit operations such as pg_atomic_fetch_add_u64() and should not be
used.
>
> Can someone definitively confirm whether it is okay to rely on the 64 bit
atomics
> or whether it is better to protect 64 bit operations with a spinlock?
>
> Thanks!
> John

Golang has asm implementations for these even on 32bit platforms (see
https://github.com/golang/go/tree/master/src/sync/atomic)

Couldn't we borrow them? Or even better, fall back to spin lock on these,
but transparently.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-05-27 20:05:12 Re: Status of 64 bit atomics
Previous Message Alvaro Herrera 2016-05-27 19:30:46 Re: [PROPOSAL] Move all am-related reloption code into src/backend/access/[am-name] and get rid of relopt_kind