diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-11-01 14:54:13 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-11-01 14:54:13 +0900 |
commit | fe705ef6fc1d1b4b48aea94a1dd2835a6630dacf (patch) | |
tree | 95cd1f6ec9722d2fb073bb0a02370d773bd329cc /contrib/postgres_fdw/postgres_fdw.c | |
parent | 6ec62b779907e2fa49283a7d1dbd761fb64675f1 (diff) | |
download | postgresql-fe705ef6fc1d1b4b48aea94a1dd2835a6630dacf.tar.gz postgresql-fe705ef6fc1d1b4b48aea94a1dd2835a6630dacf.zip |
doc: Expand section related to LWLocks and shared memory
The documentation includes a section describing how to define custom
LWLocks in extensions using the shmem hooks. However, it has never
mentioned the second, more flexible method based on the following
routines:
- LWLockNewTrancheId() to allocate a tranche ID.
- LWLockRegisterTranche() to associate a name to a tranche ID.
- LWLockInitialize() to initialize a LWLock with a tranche ID.
autoprewarm.c is the only example of extension in the tree that
allocates a LWLock this way.
This commit adds some documentation about all that. While on it, a
comment is added about the need of AddinShmemInitLock. This is required
especially for EXEC_BACKEND builds (aka Windows, normally), as per a
remark from Alexander, because backends can execute shmem initialization
paths concurrently.
Author: Aleksander Alekseev, Michael Paquier
Discussion: https://postgr.es/m/CAJ7c6TPKhFgL+54cdTD9yGpG4+sNcyJ+N1GvQqAxgWENAOa3VA@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions