Re: [GENERAL] Difficult while acquiring LWLocks - Mailing list pgsql-general

From Julien Rouhaud
Subject Re: [GENERAL] Difficult while acquiring LWLocks
Date
Msg-id 46c8d952-48e5-719f-364c-e1a311817d3f@dalibo.com
Whole thread Raw
In response to [GENERAL] Difficult while acquiring LWLocks  (hariprasath nallasamy <hariprasathnallasamy@gmail.com>)
Responses Re: [GENERAL] Difficult while acquiring LWLocks  (hariprasath nallasamy <hariprasathnallasamy@gmail.com>)
List pgsql-general
On 03/05/2017 13:08, hariprasath nallasamy wrote:
> Hi all
>    There is an use case, where i want some 10 LightWeight Locks and
> after 9.6 LW locks api's (LWLockAssign) are changed a bit and i am
> confused too.
>
>  Only reference i cant get was from pg_stat_statement :(
>
> Since GetNamedLWLockTranche method will return the base address of the
> specified tranche.
>
> From pg_init
> *" RequestNamedLWLockTranche("Some_10_LWLocks", 10); "
>
>
> *For getting those locks which were requested from pg_init
> *" LWLockPadded *lwLockPadded = GetNamedLWLockTranche("Some_10_LWLocks");
>    LWLock *lock = &(lwLockPadded[index in 0 to 9]).lock; "*
>
> Is the above code snippet a valid for requesting some 10 LWLocks?
>
>

AFAIK yes this is the correct way to use multiple lwlocks.

--
Julien Rouhaud
http://dalibo.com - http://dalibo.org


pgsql-general by date:

Previous
From: hariprasath nallasamy
Date:
Subject: [GENERAL] Difficult while acquiring LWLocks
Next
From: hariprasath nallasamy
Date:
Subject: Re: [GENERAL] Difficult while acquiring LWLocks