Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)
Date
Msg-id 1552803.1592497780@sss.pgh.pa.us
Whole thread Raw
In response to Re: global barrier & atomics in signal handlers (Re: Atomicoperations within spinlocks)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: global barrier & atomics in signal handlers (Re: Atomicoperations within spinlocks)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jun 18, 2020 at 11:59 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Sure, but wouldn't making the SpinLockAcquire layer into static inlines be
>> sufficient to address that point, with no need to touch s_lock.h at all?

> I mean, wouldn't you then end up with a bunch of 1-line functions
> where you can step into the function but not through whatever
> individual things it does?

Not following your point.  The s_lock.h implementations tend to be either
simple C statements ("*lock = 0") or asm blocks; if you feel a need to
step through them you're going to be resorting to "si" anyway.

I think the main usefulness of doing anything here would be (a) separating
the spinlock infrastructure from callers and (b) ensuring that we have a
declared argument type, and single-evaluation semantics, for the spinlock
function parameters.  Both of those are adequately addressed by fixing
spin.h, IMO anyway.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: jsonpath versus NaN
Next
From: Robert Haas
Date:
Subject: Re: [patch] demote