thread_pool_set_size
Synopsis
#include <flint/thread_pool.h>int thread_pool_set_size(thread_pool_t T, slong new_size)sourceIf every thread of T is available, replaces them by new_size new threads (none if \mathit{new\_size} \le 0 or FLINT was built without pthreads) and returns 1. Otherwise changes nothing and returns 0.
All old threads are told to exit and joined, even if the size does not change, and new threads are created. Resizing therefore costs a thread creation per thread and should not be done in a loop.
Cite this page
The FLINT team, “thread_pool_set_size (thread_pool.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/thread_pool/thread_pool_set_size.html (generated 2026-10-20).
@misc{flint-doc-thread-pool-thread-pool-set-size,
author = {{The FLINT team}},
title = {{thread\_pool\_set\_size (thread\_pool.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/thread_pool/thread_pool_set_size.html},
note = {Generated 2026-10-20}
}