zanmato1984 commented on code in PR #41614:
URL: https://github.com/apache/arrow/pull/41614#discussion_r1598668948
##########
cpp/src/arrow/acero/asof_join_node.cc:
##########
@@ -548,8 +548,10 @@ class InputState {
// true when the queue is empty and, when memo may have future entries (the
case of a
// positive tolerance), when the memo is empty.
// used when checking whether RHS is up to date with LHS.
- bool CurrentEmpty() const {
- return memo_.no_future_ ? Empty() : memo_.times_.empty() && Empty();
+ // NOTE: The emptiness must be decided by an atomic all to Empty() in
caller, due to the
+ // potential race with Push(), see GH-41614.
+ bool CurrentEmpty(bool empty) const {
+ return memo_.no_future_ ? empty : memo_.times_.empty() && empty;
Review Comment:
Honestly I can't tell for 100% sure. But from my understanding of the code
so far, we are good. Unlike the race happening on the `queue_`, between on side
being `Push` and the other being `Process`, the `memo_` seems only to be
manipulated by the `Process` thread which is in good sync with itself.
--
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]