Re: Is there any way to request unique lwlock inside a backgroundworker in PG9.4?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Is there any way to request unique lwlock inside a backgroundworker in PG9.4?
Дата
Msg-id 20181017152153.siixalfswysfygn5@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Is there any way to request unique lwlock inside a backgroundworker in PG9.4?  (Hubert Zhang <hzhang@pivotal.io>)
Ответы Re: Is there any way to request unique lwlock inside a backgroundworker in PG9.4?
Список pgsql-hackers
Hi,

On 2018-10-17 23:11:26 +0800, Hubert Zhang wrote:
> The section "Share Memory and LWLocks" describe the AddinShmemInitLock which
> is used to protect the ShmemInitStruct() when backend workers initialize
> their shm.  My requirement is to how to protect the shm access within the
> bgworkers(not at init stage). This lock should be bgworkers specific.

Rereead the page please. After you RequestAddinLWLocks() during
initialization, you can use LWLockAssign() to get an lwlock. Which you
then can use as is your pleasure.

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jakob Egger
Дата:
Сообщение: Re: PG vs macOS Mojave
Следующее
От: Nikolay Shaplov
Дата:
Сообщение: Re: pageinspect: add tuple_data_record()