kDefaultFileConcurrency top-level constant
int
const kDefaultFileConcurrency
File-level (batch) concurrency (Step 2). W = whole FILES transferred at once in a batch directory upload/download — the bigger real-world win when syncing many files. Each file ALSO runs Step 1 chunk concurrency internally, so the dangerous quantity is the PRODUCT (W files × N chunks each). One shared ChunkSemaphore caps that product across the whole batch: every chunk transfer (sequential OR concurrent path) takes one permit before the network call and releases it after, so total in-flight is bounded regardless of how W and the per-file degree combine. (The per-chunk MemoryGate still bounds bytes; this bounds the cross-file count.)
Implementation
const int kDefaultFileConcurrency = 4;