Re: Fix spinlock usage in UnpinBuffer()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix spinlock usage in UnpinBuffer()
Date: 2005-12-29 18:13:25
Message-ID: 19982.1135880005@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> Remove SpinLockAcquire_NoHoldoff() and related. Now SpinLockAcquire() will
> not holdoff cancle/die interrupts. This will give cleaner and clearer
> useage of spinlock and also save a few cycles.

Applied with some minor comment updates.

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.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-12-29 18:44:43 Re: pl/python: fix ref leak on elog
Previous Message Bruce Momjian 2005-12-29 17:15:23 Re: to_char and i18n