Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Date: 2020-05-25T15:14:39Z
Lists: 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
Commits
-
Add unlikely() to CHECK_FOR_INTERRUPTS()
- c5262cfd59cb 10.14 landed
- 3cbf4be3e0eb 11.9 landed
- 8401ad52350e 12.4 landed
- 87fb04af1e70 13.0 landed
-
Add CHECK_FOR_INTERRUPTS() to the repeat() function
- 36758c472ea7 11.9 landed
- 3ccae5445cc8 12.4 landed
- 887cdff4dcbd 13.0 landed
- bfb9595a786e 9.5.23 landed
- 28e2c6eacc69 9.6.19 landed
- 2cbe3a954219 10.14 landed