Re: dsm_unpin_segment - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: dsm_unpin_segment
Date
Msg-id CAEepm=0kaqZEM7AZADSCfik065z__7khNvRog8mn-cV+dUK3RA@mail.gmail.com
Whole thread Raw
In response to Re: dsm_unpin_segment  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: dsm_unpin_segment  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Tue, Aug 23, 2016 at 12:07 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> + int control_slot = -1;
> ...
> + if (control_slot == -1)
> + elog(ERROR, "cannot unpin unknown segment handle");
>
> Isn't it better to use INVALID_CONTROL_SLOT for control_slot and use
> datatype as uint32 (same is used for dsm_segment->control_slot and
> nitems)?

Yes, it is better.  New version attached.

> Apart from this, I have verified your patch on Windows using attached
> dsm_demo module.  Basically, by using dsm_demo_create(), I have pinned
> the segment and noticed that Handle count of postmaster is incremented
> by 1 and then by using dsm_demo_unpin_segment() unpinned the segment
> which decrements the Handle count in Postmaster.

Thanks!

--
Thomas Munro
http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: LSN as a recovery target
Next
From: Kuntal Ghosh
Date:
Subject: WAL consistency check facility