Re: Shared memory and memory context question

From: Neil Conway <neilc(at)samurai(dot)com>
To: richard(dot)hills(at)balliol(dot)oxford(dot)ac(dot)uk
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shared memory and memory context question
Date: 2006-02-06 01:09:16
Message-ID: 1139188156.9135.25.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2006-02-05 at 14:03 +0000, richard(at)playford(dot)net wrote:
> 3. Somehow create shared memory using the shmem functions, and set a memory
> context to live *inside* this shared memory, which my trigger functions can
> then switch to. Then use palloc() and pfree() without worrying..

This has been done before, by the TelegraphCQ folks: they implemented a
shared memory MemoryContext on top of OSSP MM[1]. The code is in the
v0.2 TelegraphCQ tarball[2] -- see shmctx.c and shmset.c in
src/backend/utils/mmgr/. I'm not aware of an independent distribution,
but you could probably separate it out without too much pain.

(Of course, the comments elsewhere in the thread about using an
alternative are probably still true...)

-Neil

[1] http://www.ossp.org/pkg/lib/mm/
[2] http://telegraph.cs.berkeley.edu/downloads/TelegraphCQ-0.2.tar.gz

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2006-02-06 03:14:49 Re: Copy From & Insert UNLESS
Previous Message James William Pye 2006-02-06 00:51:01 Re: Copy From & Insert UNLESS