Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Дата
Msg-id ecc446ea-07d8-537d-9341-27be592956aa@joeconway.com
обсуждение исходный текст
Ответ на Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 5/25/20 9:52 AM, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>>> Comments or objections?
>
>> Seeing none ... I intend to backpatch and push these two patches in the next day
>> or so.
>
> There was some question as to what (if anything) to do with the Windows
> version of CHECK_FOR_INTERRUPTS.  Have you resolved that?


Relevant hunk:

*************** do { \
*** 107,113 ****
  do { \
      if (UNBLOCKED_SIGNAL_QUEUE()) \
          pgwin32_dispatch_queued_signals(); \
!     if (InterruptPending) \
          ProcessInterrupts(); \
  } while(0)
  #endif                            /* WIN32 */
--- 107,113 ----
  do { \
      if (UNBLOCKED_SIGNAL_QUEUE()) \
          pgwin32_dispatch_queued_signals(); \
!     if (unlikely(InterruptPending)) \
          ProcessInterrupts(); \
  } while(0)
  #endif                            /* WIN32 */


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.

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.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions