Skip site navigation (1) Skip section navigation (2)

Re: Display Pg buffer cache (WIP)

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Display Pg buffer cache (WIP)
Date: 2005-03-04 00:30:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Neil Conway wrote:
> I don't like accessing shared data structures without acquiring the 
> appropriate locks; even if it doesn't break anything, it seems like just 
> asking for trouble. In order to be able to inspect a buffer's tag in 
> Tom's new locking scheme (not yet in HEAD, but will be in 8.1), you need 
> only hold a per-buffer lock. That will mean acquiring and releasing a 
> spinlock for each buffer, which isn't _too_ bad...

I am looking at this bit now.

I take the first part to mean that don't need to wrap
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE) ... LWLockRelease(BufMgrLock)
around the inspection of the buffers (?)

This per buffer lock, are we talking about LockBuffer(buf,
BUFFER_LOCK_SHARE) ... releaseBuffer(buf) ?

If so, it looks like I need to do some stuff with ResourceOwners,
otherwise ReleaseBuffer will fail (or am I wandering up the wrong track
here?). I am using anoncvs from yesterday, so if Tom's new scheme is
*very* new I may be missing it.



In response to


pgsql-patches by date

Next:From: Neil ConwayDate: 2005-03-04 01:49:56
Subject: Re: Display Pg buffer cache (WIP)
Previous:From: Neil ConwayDate: 2005-03-04 00:11:12
Subject: Re: Faster install-sh in C

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group