On 2015-12-02 14:48:24 -0600, Kevin Grittner wrote: > On Wed, Dec 2, 2015 at 12:39 AM, Michael Paquier > <michael.paqu...@gmail.com> wrote: > > On Mon, Nov 9, 2015 at 8:07 AM, Steve Singer <st...@ssinger.info> wrote: > > >> In snapmgr.c > >> > >> > >> + * XXX: If we can trust a read of an int64 value to be atomic, we can > >> skip the > >> + * spinlock here. > >> + */ > >> +int64 > >> +GetOldSnapshotThresholdTimestamp(void) > >> > >> > >> Was your intent with the XXX for it to be a TODO to only aquire the lock on > >> platforms without the atomic 64bit operations? > > I'm not sure whether we can safely assume a read of an int64 to be > atomic on any platform; if we actually can on some platforms, and > we have a #define to tell us whether we are in such an environment, > we could condition the spinlock calls on that. Are we there yet?
We currently don't assume it's atomic. And there are platforms, e.g 32 bit arm, where that's not the case (c.f. https://wiki.postgresql.org/wiki/Atomics). It'd be rather useful to abstract that knowledge into a macro... Andres -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers