From 7c4fd520846dccf99cd255dffc469f4ddaa292da Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 11 Jul 2023 16:43:34 -0700 Subject: [PATCH] Promise not to buffer `par_bridge` --- src/iter/par_bridge.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/iter/par_bridge.rs b/src/iter/par_bridge.rs index 8398274b3..eb058d3e6 100644 --- a/src/iter/par_bridge.rs +++ b/src/iter/par_bridge.rs @@ -13,6 +13,11 @@ use crate::{current_num_threads, current_thread_index}; /// `par_iter` instead. However, it can still be useful for iterators that are difficult to /// parallelize by other means, like channels or file or network I/O. /// +/// Iterator items are pulled by `next()` one at a time, synchronized from each thread that is +/// ready for work, so this may become a bottleneck if the serial iterator can't keep up with the +/// parallel demand. The items are not buffered by `IterBridge`, so it's fine to use this with +/// large or even unbounded iterators. +/// /// The resulting iterator is not guaranteed to keep the order of the original iterator. /// /// # Examples