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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: hzhang(at)pivotal(dot)io
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is there any way to request unique lwlock inside a background worker in PG9.4?
Date: 2018-10-17 11:50:46
Message-ID: CAA4eK1+6edDNLWxHFpDybcp5_HtZ64XcqAF3VcxbK-hG-sJ0kA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 17, 2018 at 3:49 PM Hubert Zhang <hzhang(at)pivotal(dot)io> wrote:
>
> Hi all,
>
> I want to init SHM in a background worker, which is supported in PG9.4. Also I need to use lwlock to protect the share memory inside the worker code.
>
> RequestNamedLWLockTranche is the way to handle it, but it's not supported in PG 9.4, is there any way I could request an unique lock inside worker init code in PG 9.4?
>

You might want to look at section "Shared Memory and LWLocks" in the docs [1].

[1] - https://www.postgresql.org/docs/9.4/static/xfunc-c.html

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakob Egger 2018-10-17 12:11:04 Re: PG vs macOS Mojave
Previous Message Hubert Zhang 2018-10-17 10:19:06 Is there any way to request unique lwlock inside a background worker in PG9.4?