From:
Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject:
Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay,
Kevin! Thanks, reviewers!)
Date:
2010-09-06 06:33:14
Message-ID:
4C848B2A.9090102@enterprisedb.com (view raw or flat )
Thread:
2010-08-18 20:40:20 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-08-18 21:21:05 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-08-18 23:46:08 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-08-19 01:46:45 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-08-19 06:02:34 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-19 13:38:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 16:23:23 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-19 16:57:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 17:04:09 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-19 17:18:57 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 17:36:09 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-19 17:59:51 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-20 13:15:48 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-20 13:24:31 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-20 14:15:47 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-20 14:28:04 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-23 21:30:04 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-23 23:44:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-24 01:08:21 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-08-24 08:42:49 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-26 10:40:10 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-27 07:39:14 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-08-27 08:15:28 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-31 07:06:42 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-31 10:40:10 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-08-31 12:47:51 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-09-01 07:11:39 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-02 03:46:16 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-09-02 18:30:59 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-02 20:13:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 02:02:25 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-09-03 02:08:08 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 04:19:17 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-09-03 14:07:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 15:43:50 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-03 16:10:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 16:38:52 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-03 20:20:46 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-03 21:30:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-03 22:24:18 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-04 01:19:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-05 16:58:29 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-09-03 21:52:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-05 10:44:27 from Greg Stark <gsstark(at)mit(dot)edu>
2010-09-03 19:11:58 from Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
2010-09-03 20:17:01 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-03 10:50:54 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-03 14:51:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 17:59:17 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-03 18:16:01 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-03 18:43:23 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-03 18:50:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-06 06:33:14 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-06 14:18:04 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-06 16:27:05 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-06 17:24:59 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-06 18:46:30 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-06 20:10:57 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-06 21:03:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-08 17:36:17 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-08 18:01:01 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-08 18:18:41 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-09 08:17:18 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-09 08:34:42 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-07 07:01:51 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-07 07:06:20 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-07 08:22:51 from Markus Wanner <markus(at)bluegap(dot)ch>
2010-09-08 20:07:29 from Martijn van Oosterhout <kleptog(at)svana(dot)org>
2010-09-08 20:49:29 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-09 05:32:39 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-11 09:48:59 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-11 15:02:45 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-11 16:15:52 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-12 16:15:15 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-09-12 16:29:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-12 17:13:19 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-09-12 17:23:43 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-09-12 18:12:20 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-09-12 18:26:58 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-09-13 06:10:29 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-09-13 17:43:16 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-09-13 18:01:49 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-08-27 21:54:05 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-08-27 22:13:11 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-08-28 01:11:53 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-28 01:26:15 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-28 01:43:36 from Greg Stark <gsstark(at)mit(dot)edu>
2010-08-28 21:00:31 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-08-31 15:40:21 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-08-20 06:54:38 from tomas(at)tuxteam(dot)de
2010-08-19 15:08:38 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-08-19 15:11:01 from Magnus Hagander <magnus(at)hagander(dot)net>
2010-08-19 16:16:42 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Lists:
pgsql-hackers
On 03/09/10 21:50, Tom Lane wrote:
> Heikki Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> On 03/09/10 21:16, Tom Lane wrote:
>>> It's probably not too unreasonable to assume that pid_t assignment is
>>> atomic. But I'm still thinking that we have bigger problems than that
>>> if there are really cases where SetLatch can execute at approximately
>>> the same time as a latch owner is coming or going.
>
>> I don't see how to avoid it. A walsender, or any process really, can
>> exit at any time. It can make the latch inaccessible to others before it
>> exits to minimize the window, but it's always going to be possible that
>> another process is just about to call SetLatch when you exit.
>
> Well, in that case what we need to do is presume that the latch object
> has a continuing existence but the owner/receiver can come and go.
> I would suggest that InitLatch needs to initialize the object into a
> valid but unowned state; there is *no* deinitialize operation; and
> there are AcquireLatch and ReleaseLatch operations to become owner
> or stop being owner.
I think we have just a terminology issue. What you're describing is
exactly how it works now, if you just s/InitLatch/AcquireLatch. At the
moment there's no need for an initialization function other than the
InitLatch/AcquireLatch that associates the latch with the current
process. I can add one for the sake of future-proofing, and to have
better-defined behavior for setting a latch that has not been owned by
anyone yet, but it's not strictly necessary.
> We also need to define the semantics of SetLatch
> on an unowned latch --- does this set a signal condition that will be
> available to the next owner?
At the moment, no. Perhaps that would be useful, separating the Init and
Acquire operations is needed to make that sane.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
In response to
Responses
pgsql-hackers by date
Next :From: Pavel StehuleDate: 2010-09-06 06:37:18
Subject : Re: string function - "format" function proposal
Previous :From : Itagaki TakahiroDate : 2010-09-06 05:16:44
Subject : Re: string function - "format" function proposal