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

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date
Msg-id 3736.1460476321@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
I wrote:
> 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.

It strikes me that that means you could stick with this initialization
method if you made the macro argument be a literal constant string name,
like "buffer spinlock", and printed that rather than the address in
s_lock_stuck.  This would be different from what we do now, but not
necessarily any less useful.  I'm pretty dubious of the usefulness of
the addresses you're printing right now, because most of them are indeed
not the spinlock itself.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Some other things about contrib/bloom and generic_xlog.c
Next
From: Alexander Korotkov
Date:
Subject: Re: Some other things about contrib/bloom and generic_xlog.c