ishaaaan17 commented on code in PR #53160:
URL: https://github.com/apache/arrow/pull/53160#discussion_r4354516180
##########
cpp/src/arrow/compute/kernels/scalar_string_test.cc:
##########
@@ -1927,6 +1965,41 @@ TYPED_TEST(TestBaseBinaryKernels, MatchLikeEscaping) {
this->CheckUnary("match_like", R"(["\n\tfoo\t", "\n\t", "\n"])", boolean(),
"[true, true, false]", &escape_sequences);
}
+
+TYPED_TEST(TestBaseBinaryKernels, MatchLikeConcurrentFirstUse) {
Review Comment:
thanks for the reviews @lriggs!
1. **atomic barrier:** you are right about the thread scheduling delay, and
about making sure all the threads really race on the first initialization
together. i changed the test synchronization to use an atomic countdown
barrier: a `waiting` counter and a `go` flag with acquire/release ordering, and
`std::this_thread::yield()` inside the spin-waits so cores are not starved on
slow runners.
2. **re2 test:** i added `MatchSubstringRegexConcurrentFirstUse`, which uses
`call("match_substring_regex", ...)` with the same atomic barrier, under
`#ifdef ARROW_WITH_RE2`.
3. i also added inline comments to all three concurrent test functions, to
explain the two-phase barrier synchronization.
pushed the updated revision.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]