Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance

From: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>, Magnus Hagander <mha(at)sollentuna(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance
Date: 2005-10-25 04:06:22
Message-ID: Pine.LNX.4.58.0510242359320.31231@eon.cs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 24 Oct 2005, Tom Lane wrote:

> Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> > I tried to persuade myself that removing all WaitForSingleObjectEx() is
> > safe ... the thing is we will false alarm EINTR as Magnus said (details to
> > repeat it are list below in case).
>
> Just to repeat myself: there were false alarms before. The interleaving
> you describe could equally well happen if a new signal is sent just
> after the old code executes WaitForSingleObjectEx and sees that a
> previous signal is waiting for it. Both old and new signals can be
> cleared by the recipient before the second signal sender gets as far as
> setting the event.
>

Oh, yeah. Just write the detailed case down for the sake of memory:

-- For previous code -- false alarm case --
1. I am killing you signal A:
enter_crit;
set signal bit;
leave_crit;

2. He *has killed* you signal B:

3. You CHECK_FOR_INTERRUPTS():
enter_crit;
sig(A);
sig(B);
ResetEvent();
leave_crit;

4. I finish my killing:
SetEvent();

Now the event is signaled but the signal is handled already.

Regards,
Qingqing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-10-25 04:23:51 Re: BUG #1993: Adding/subtracting negative time intervals
Previous Message Tom Lane 2005-10-25 04:03:58 Re: BUG #1993: Adding/subtracting negative time intervals