Re: atomic reads & writes (with no barriers)

From: Greg Stark <stark(at)mit(dot)edu>
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 12:35:24
Message-ID: CAM-w4HOxHXpqdtQub7dwehZygpehanR30bxUx+-ERoFYkSG4vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 3, 2015 at 10:10 PM, Kevin Grittner <kgrittn(at)gmail(dot)com> 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?

It would be nicer if we could come up with an interface that didn't
require #ifdefs everywhere it's used.

Something like
...
pg_maybe_atomic int64 threshold_timestamp;
...

SpinLockAcquire_if_no_atomics(...)
threshold_timestamp = &oldSnapshotControl->threshold_timestamp;
SpinLockRelease_if_no_atomics(...)

return threshold_timestamp;

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ildus Kurbangaliev 2015-12-04 12:47:18 Support of partial decompression for datums
Previous Message Aleksander Alekseev 2015-12-04 12:15:04 Patch: ResourceOwner optimization for tables with many partitions