Skip to content
Discussion options

You must be logged in to vote

Expanding on @KOKOSde's answer with the specific shape of the API:

Scanner::Scan(visitor) is single-consumer by design — the visitor is serialised across batches regardless of use_threads. use_threads parallelizes everything upstream of your visitor (file open, decompression, decode), and the threads fan back into a single-consumer pipeline where your visitor sees one batch at a time. Your 5-second sleep back-pressures that pipeline, so the decode threads finish early and then idle waiting for your visitor to drain. That's why you're seeing "ThreadId X, ThreadId X, ThreadId X" — there's exactly one consumer thread calling into your visitor.

ScanBatchesUnordered is the same contract with o…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@moba15
Comment options

@raulcd
Comment options

raulcd May 11, 2026
Collaborator

@moba15
Comment options

Answer selected by moba15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants