Re: reorganize "Shared Memory and LWLocks" section of docs - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: reorganize "Shared Memory and LWLocks" section of docs
Date
Msg-id CAJ7c6TNC-tC9JS_X_FSShDEeGujrUdunVdtBBm+YGg8VW+AkFg@mail.gmail.com
Whole thread Raw
In response to reorganize "Shared Memory and LWLocks" section of docs  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: reorganize "Shared Memory and LWLocks" section of docs
List 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



pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: plpgsql memory leaks
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Synchronizing slots from primary to standby