Re: reorganize "Shared Memory and LWLocks" section of docs

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: reorganize "Shared Memory and LWLocks" section of docs
Date: 2024-01-12 14:12:28
Message-ID: CAJ7c6TNC-tC9JS_X_FSShDEeGujrUdunVdtBBm+YGg8VW+AkFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> I recently began trying to write documentation for the dynamic shared
> memory registry feature [0], and I noticed that the "Shared Memory and
> LWLocks" section of the documentation might need some improvement.

I know that feeling.

> Thoughts?

"""
Any registered shmem_startup_hook will be executed shortly after each
backend attaches to shared memory.
"""

IMO the word "each" here can give the wrong impression as if there are
certain guarantees about synchronization between backends. Maybe we
should change this to simply "... will be executed shortly after
[the?] backend attaches..."

"""
should ensure that only one process allocates a new tranche_id
(LWLockNewTrancheId) and initializes each new LWLock
(LWLockInitialize).
"""

Personally I think that reminding the corresponding function name here
is redundant and complicates reading just a bit. But maybe it's just
me.

Except for these nitpicks the patch looks good.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2024-01-12 14:21:14 RE: Synchronizing slots from primary to standby
Previous Message Michael Banck 2024-01-12 13:53:45 Re: plpgsql memory leaks