A thread pool runs callable tasks across several worker threads. In Python, ThreadPoolExecutor from concurrent.futures can parallelize repeated bootstrap calculations, but parallel work adds scheduling and result-combination overhead. section 7.2.2
Parallel bootstrap confidence intervals
The example creates four workers, maps each bootstrap sample to a nested single_bootstrap function, and collects the statistics before calculating percentile bounds. The parallel version became slower for the small dataset, illustrating that more threads do not guarantee faster execution.
Check these constraints before choosing a thread pool:
- Account for overhead from dividing work, starting and queuing tasks, and combining results. section 7.2.2
- Expect limited benefits when the workload uses custom functions on Pandas DataFrames because Python's GIL may constrain parallelization. section 7.2.2









