Re: dynamically allocating chunks from shared memory - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: dynamically allocating chunks from shared memory
Date
Msg-id 1279823238-sup-6350@alvh.no-ip.org
Whole thread Raw
In response to Re: dynamically allocating chunks from shared memory  (Markus Wanner <markus@bluegap.ch>)
Responses Re: dynamically allocating chunks from shared memory
List pgsql-hackers
Excerpts from Markus Wanner's message of jue jul 22 08:49:29 -0400 2010:

> Of course, as mentioned in the bgworker patch, this could be done 
> differently. Using solely shared memory, or maybe SLRU to store change 
> sets. However, I certainly like the abstraction and guarantees such a 
> message passing system provides. It makes things easier to reason about, 
> IMO.

FWIW I don't think you should be thinking in "replacing imessages with
SLRU".  I rather think you should be thinking in how can you implement
the imessages API on top of SLRU.  So as far as the coordinator and
background worker are concerned, there wouldn't be any difference --
they keep using the same API they are using today.

Also let me repeat my earlier comment about imessages being more similar
to multixact than to notify.  The content of each multixact entry is
just an arbitrary amount of bytes.  If imessages are numbered from a
monotonically increasing sequence, it should be possible to use a very
similar technique, and perhaps you should be able to reduce locking
requirements as well (write messages with only a shared lock, after
you've determined and reserved the area you're going to write).


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: CommitFest 2010-07 week one progress report
Next
From: Robert Haas
Date:
Subject: Re: [RRR] CommitFest 2010-07 week one progress report