Question about BarrierAttach spinlock

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Question about BarrierAttach spinlock
Date: 2019-05-23 16:10:35
Message-ID: CAE-h2TrQ6A51Dbyf+advNZP6wsbb+ERZWm6bNm=L9pN6aGVE4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

In src/backend/storage/ipc/barrier.c, BarrierAttach
goes to the bother of storing the phase before
releasing the spinlock, and then returns the phase.

In nodeHash.c, ExecHashTableCreate ignores the
phase returned by BarrierAttach, and then immediately
calls BarrierPhase to get the phase that it just ignored.
I don't know that there is anything wrong with this, but
if the phase can be retrieved after the spinlock is
released, why hold the spinlock extra long in
BarrierAttach?

Just asking....

mark

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-23 16:48:49 Re: Is it safe to ignore the return value of SPI_finish and SPI_execute?
Previous Message Tom Lane 2019-05-23 16:06:22 Re: Memory bug in dsnowball_lexize