Re: Buffer Management - Mailing list pgsql-hackers

From Curt Sampson
Subject Re: Buffer Management
Date
Msg-id Pine.NEB.4.43.0206252318020.670-100000@angelic.cynic.net
Whole thread Raw
In response to Re: Buffer Management  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Buffer Management  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 25 Jun 2002, Tom Lane wrote:

> The only thing you'd really have to think about is how to replace the
> current behavior that uses shmem attach counts to discover whether any
> old backends are left over from a previous crashed postmaster.  I dunno
> if mmap offers any comparable facility.

Sure. Just mmap a file, and it will be persistent.

> The other discussion seemed to be considering how to mmap individual
> data files right into backends' address space.  I do not believe this
> can possibly work, because of loss of control over visibility of data
> changes to other backends, timing of write-backs, etc.

I don't understand why there would be any loss of visibility of changes.
If two backends mmap the same block of a file, and it's shared, that's
the same block of physical memory that they're accessing. Changes don't
even need to "propagate," because the memory is truly shared. You'd keep
your locks in the page itself as well, of course.

Can you describe the problem in more detail?

> But as long as you stay away from interpretation #2 and go with
> mmap-as-a-shmget-substitute, it might be worthwhile.

It's #2 that I was really looking at. :-)

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 





pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Buffer Management
Next
From: Bruce Momjian
Date:
Subject: Re: Buffer Management