Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Date
Msg-id 696.1590419679@sss.pgh.pa.us
Whole thread Raw
In response to Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()  (Joe Conway <mail@joeconway.com>)
Responses Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> On 5/25/20 9:52 AM, Tom Lane wrote:
>> There was some question as to what (if anything) to do with the Windows
>> version of CHECK_FOR_INTERRUPTS.  Have you resolved that?

> Two questions.

> First, as I understand it, unlikely() is a gcc thing, so it does nothing at all
> for MSVC builds of Windows, which presumably are the predominate ones. The
> question here is whether it is worth doing at all for Windows builds. On the
> other hand it seems unlikely to harm anything, so I think it is reasonable to
> leave the patch as is in that respect.

Perhaps I'm an optimist, but I think that eventually we will figure out
how to make unlikely() work for MSVC.  In the meantime we might as well
let it work for gcc-on-Windows builds.

> The second question is whether UNBLOCKED_SIGNAL_QUEUE() warrants its own
> likely() or unlikely() wrapper. I have no idea, but we could always add that
> later if someone deems it worthwhile.

I think that each of those tests should have a separate unlikely() marker,
since the whole point here is that we don't expect either of those tests
to yield true in the huge majority of CHECK_FOR_INTERRUPTS executions.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Erik Rijkers
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions