Re: Introduce timeout capability for ConditionVariableSleep

2019-07-22 Thread Thomas Munro
On Tue, Jul 16, 2019 at 1:11 AM Robert Haas wrote: > On Fri, Jul 12, 2019 at 11:03 PM Thomas Munro wrote: > > I pushed this too. It's a separate commit, because I think there is > > at least a theoretical argument that it should be back-patched. I'm > > not going to do that today though, becaus

Re: Introduce timeout capability for ConditionVariableSleep

2019-07-15 Thread Robert Haas
On Fri, Jul 12, 2019 at 11:03 PM Thomas Munro wrote: > I pushed this too. It's a separate commit, because I think there is > at least a theoretical argument that it should be back-patched. I'm > not going to do that today though, because I doubt anyone is relying > on ConditionVariableSignal() w

Re: Introduce timeout capability for ConditionVariableSleep

2019-07-12 Thread Thomas Munro
On Fri, Jul 12, 2019 at 6:08 PM Shawn Debnath wrote: > On Tue, Jul 09, 2019 at 11:03:18PM +1200, Thomas Munro wrote: > > On Sun, Jul 7, 2019 at 3:09 PM Thomas Munro wrote: > > > + /* Timed out */ > > > + if (rc == 0) > > > + return true; > > > > H

Re: Introduce timeout capability for ConditionVariableSleep

2019-07-09 Thread Thomas Munro
On Sun, Jul 7, 2019 at 3:09 PM Thomas Munro wrote: > + /* Timed out */ > + if (rc == 0) > + return true; Here's a version without that bit, because I don't think we need it. > That still leaves the danger that the CV can be signalled some time >

Re: Introduce timeout capability for ConditionVariableSleep

2019-07-06 Thread Thomas Munro
On Fri, Jul 5, 2019 at 1:40 PM Thomas Munro wrote: > I think this is looking pretty good and I'm planning to commit it > soon. The convention for CHECK_FOR_INTERRUPTS() in latch wait loops > seems to be to put it after the ResetLatch(), so I've moved it in the > attached version (though I don't t

Re: Introduce timeout capability for ConditionVariableSleep

2019-07-04 Thread Thomas Munro
On Fri, Mar 22, 2019 at 7:21 AM Shawn Debnath wrote: > > On Sat, Mar 16, 2019 at 03:27:17PM -0700, Shawn Debnath wrote: > > > + * Track the current time so that we can calculate the > > > remaining timeout > > > + * if we are woken up spuriously. > > > > > > I think tha "track" means chasi

Re: Introduce timeout capability for ConditionVariableSleep

2019-03-14 Thread Kyotaro HORIGUCHI
Hello. At Thu, 14 Mar 2019 17:26:11 -0700, Shawn Debnath wrote in <20190315002611.ga1...@f01898859afd.ant.amazon.com> > Thank you reviewing. Comments inline. > > On Wed, Mar 13, 2019 at 05:24:15PM +0900, Kyotaro HORIGUCHI wrote: > > > Agree. In my testing WaitEventSetWait did the work for calcu

Re: Introduce timeout capability for ConditionVariableSleep

2019-03-13 Thread Kyotaro HORIGUCHI
Hello. At Tue, 12 Mar 2019 17:53:43 -0700, Shawn Debnath wrote in <20190313005342.ga8...@f01898859afd.ant.amazon.com> > Hi Thomas, > > Thanks for reviewing! > > On Wed, Mar 13, 2019 at 12:40:57PM +1300, Thomas Munro wrote: > > Can we just refer to the other function's documentation for this?

Re: Introduce timeout capability for ConditionVariableSleep

2019-03-12 Thread Thomas Munro
Hi Shawn, On Wed, Mar 13, 2019 at 12:25 PM Shawn Debnath wrote: > Postgres today doesn't support waiting for a condition variable with a > timeout, although the framework it relies upon, does. This change wraps > the existing ConditionVariableSleep functionality and introduces a new > API, Condit