We present a modern C++17-compatible thread pool implementation, built from scratch with high-performance scientific computing in mind. The thread pool is implemented as a single lightweight and self-contained class, and does not have any dependencies other than the C++17 standard library, thus allowing a great degree of portability. In particular, our implementation does not utilize any high-level multithreading APIs, and thus gives the programmer precise low-level control over the details of the parallelization, which permits more robust optimizations. The thread pool was extensively tested on both AMD and Intel CPUs with up to 40 cores and 80 threads.
翻译:我们提出了一种现代C++17兼容的线程池实现,该实现从零开始构建,专为高性能科学计算而设计。该线程池以单一轻量级自包含类的形式实现,除C++17标准库外无任何依赖项,因而具备高度的可移植性。特别值得注意的是,我们的实现未使用任何高级多线程API,从而赋予程序员对并行化细节的精确底层控制能力,这使得更鲁棒的优化成为可能。该线程池已在AMD和Intel CPU上进行了广泛测试,测试平台最高支持40个核心和80个线程。