Re: Fix spinlock usage in UnpinBuffer() - Mailing list pgsql-patches

From Qingqing Zhou
Subject Re: Fix spinlock usage in UnpinBuffer()
Date
Msg-id dp1cnk$h7p$1@news.hub.org
Whole thread Raw
In response to Fix spinlock usage in UnpinBuffer()  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
List pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.us> wrote
>
> I noticed that shmem.c holds ShmemIndexLock considerably longer than any
> other spinlock is held, and across operations that could theoretically
> fail (hashtable manipulations).  This doesn't matter a lot in the Unix
> code because only the postmaster ever executes ShmemInitStruct, but
> in the Windows port we run that code every time a backend is launched.
> I think that we could convert that spinlock to an LWLock.  Will look into
> it.
>

Yeah, use LWLock is a safer way in order to recover to unlock status.

Regards,
Qingqing



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: pl/python: fix ref leak on elog
Next
From: Neil Conway
Date:
Subject: Re: pl/python: fix ref leak on elog