westonpace commented on a change in pull request #9995: URL: https://github.com/apache/arrow/pull/9995#discussion_r612480026
########## File path: cpp/src/arrow/util/async_generator.h ########## @@ -1332,4 +1332,49 @@ Result<Iterator<T>> MakeReadaheadIterator(Iterator<T> it, int readahead_queue_si return MakeGeneratorIterator(std::move(owned_bg_generator)); } +/// \brief Make a generator that returns a single pre-generated future Review comment: The atomic index in VectorGenerator is not needed (mistake on my part). The mutex in MappingGenerator is neccesary. Async reentrant means that the `operator()()` method may be called before the future previously returned has completed but only after the last call to `operator()()` completed. So, for example, in MappingGenerator the state is modified by future callbacks. These future callbacks run after the call to `operator()()` completed so it's possible they will be called at the same time as the next call to `operator()()`. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org