Re: Retain dynamic shared memory segments for postmaster lifetime

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retain dynamic shared memory segments for postmaster lifetime
Date: 2014-01-29 03:35:54
Message-ID: CA+TgmoZR9FE0GdaqCZcqJaim5-0ogc6nBMLstRgeZudjTuMciw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 28, 2014 at 6:12 AM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> I had a short look on this patch.
>
> - DSM implimentation seems divided into generic part (dsm.c) and
> platform dependent part(dsm_impl.c). This dsm_keep_segment
> puts WIN32 specific part directly into dms.c. I suppose it'd
> be better defining DSM_OP_KEEP_SEGMENT and calling dms_impl_op
> from dms_keep_segment, or something.

That might not be a very good fit, but maybe there should be a
separate function exposed by dsm_impl.c to do the
implementation-dependent part of the work; it would be a no-op except
on Windows.

> - Repeated calling of dsm_keep_segment even from different
> backends creates new (orphan) handles as many as it is called.
> Simplly invoking this function in some of extensions intending
> to stick segments might results in so many orphan
> handles. Something to curb that situation would be needed.

I don't really think this is a problem. Let's just document that
dsm_keep_segment() should not be called more than once per segment.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-01-29 03:37:33 Re: updated emacs configuration
Previous Message Tom Lane 2014-01-29 03:35:30 Re: Suspicion of a compiler bug in clang: using ternary operator in ereport()