Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date: 2016-04-12 14:42:11
Message-ID: 32012.1460472131@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2016-04-12 00:32:13 -0400, Tom Lane wrote:
>> Apparently, assigning the result of init_spin_delay() is not as portable
>> as you thought.

> Hm. I'm not sure why not though? Is it because delayStatus isn't static
> or global scope?

It looks like that compiler adheres to the C89 restriction that an
initializer for an array or struct must contain only link-time-constant
expressions, even if the target object is of dynamic scope.
The macro works with a link-time-constant pointer argument, but not
with one that must be evaluated at runtime.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-04-12 14:53:12 pgsql: Remove unnecessary definition of _WIN64 in libpq/win32.mak.
Previous Message Pavel Stehule 2016-04-12 13:15:21 Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-12 14:53:58 Re: Preprocessor condition fix
Previous Message Amit Kapila 2016-04-12 14:12:11 Re: Move PinBuffer and UnpinBuffer to atomics