Question about BarrierAttach spinlock - Mailing list pgsql-hackers

From Mark Dilger
Subject Question about BarrierAttach spinlock
Date
Msg-id CAE-h2TrQ6A51Dbyf+advNZP6wsbb+ERZWm6bNm=L9pN6aGVE4A@mail.gmail.com
Whole thread Raw
Responses Re: Question about BarrierAttach spinlock  (Thomas Munro <thomas.munro@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Memory bug in dsnowball_lexize
Next
From: Tom Lane
Date:
Subject: Re: Is it safe to ignore the return value of SPI_finish and SPI_execute?