Outdated comments about proc->sem in lwlock.c

Started by Thomas Munroabout 5 years ago4 messageshackers
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

Hi,

In passing I noticed that lwlock.c contains 3 comments about bogus
wakeups due to sharing proc->sem with the heavyweight lock manager and
ProcWaitForSignal. Commit 6753333f55e (9.5) switched those things
from proc->sem to proc->procLatch. ProcArrayGroupClearXid() and
TransactionGroupUpdateXidStatus() also use proc->sem though, and I
haven't studied how those might overlap with with LWLockWait(), so I'm
not sure what change to suggest.

#2Thomas Munro
thomas.munro@gmail.com
In reply to: Thomas Munro (#1)
Re: Outdated comments about proc->sem in lwlock.c

On Wed, Mar 10, 2021 at 1:11 AM Thomas Munro <thomas.munro@gmail.com> wrote:

In passing I noticed that lwlock.c contains 3 comments about bogus
wakeups due to sharing proc->sem with the heavyweight lock manager and
ProcWaitForSignal. Commit 6753333f55e (9.5) switched those things
from proc->sem to proc->procLatch. ProcArrayGroupClearXid() and
TransactionGroupUpdateXidStatus() also use proc->sem though, and I
haven't studied how those might overlap with with LWLockWait(), so I'm
not sure what change to suggest.

Here's a patch to remove the misleading comments.

Attachments:

0001-Remove-more-obsolete-comments-about-semaphores.patchtext/x-patch; charset=US-ASCII; name=0001-Remove-more-obsolete-comments-about-semaphores.patchDownload+5-19
#3Daniel Gustafsson
daniel@yesql.se
In reply to: Thomas Munro (#2)
Re: Outdated comments about proc->sem in lwlock.c

On 3 Jun 2021, at 04:07, Thomas Munro <thomas.munro@gmail.com> wrote:

Here's a patch to remove the misleading comments.

While not an expert in the area; reading the referenced commit and the code
with the now removed comments, I think this is correct.

--
Daniel Gustafsson https://vmware.com/

#4Thomas Munro
thomas.munro@gmail.com
In reply to: Daniel Gustafsson (#3)
Re: Outdated comments about proc->sem in lwlock.c

On Thu, Jul 8, 2021 at 8:48 AM Daniel Gustafsson <daniel@yesql.se> wrote:

On 3 Jun 2021, at 04:07, Thomas Munro <thomas.munro@gmail.com> wrote:
Here's a patch to remove the misleading comments.

While not an expert in the area; reading the referenced commit and the code
with the now removed comments, I think this is correct.

Thanks! I made the comments slightly more uniform and pushed.