Re: Introduce timeout capability for ConditionVariableSleep

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Shawn Debnath <sdn@amazon.com>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-07-09T11:03:18Z
Lists: pgsql-hackers

Attachments

On Sun, Jul 7, 2019 at 3:09 PM Thomas Munro <thomas.munro@gmail.com> 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
> after ConditionVariableTimedSleep() returns.  So now I'm wondering if
> ConditionVariableCancelSleep() should signal the CV if it discovers
> that this process is not in the proclist, on the basis that that must
> indicate that we've been signalled even though we're not interested in
> the message anymore, and yet some other process else might be
> interested, and that might have been the only signal that is ever
> going to be delivered by ConditionVariableSignal().

And a separate patch to do that.  Thoughts?


--
Thomas Munro
https://enterprisedb.com

Commits

  1. Forward received condition variable signals on cancel.

  2. Introduce timed waits for condition variables.