FLINT3.7.0-dev

_thread_pool_find_work_2

Synopsis#include <flint/thread_pool.h>
ulong _thread_pool_find_work_2(ulong a, ulong alpha, ulong b, ulong beta, ulong yn, ulong yd)source

Load balancing for work with two cost rates: if the first a items cost \alpha each and the next b items cost \beta each, returns the number x of items whose total cost is the fraction y_n/y_d of the whole, rounded down. Requires y_n \le y_d. The intermediate product y_n (a \alpha + b \beta) must not overflow a word.

Cite this page

The FLINT team, “_thread_pool_find_work_2 (thread_pool.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/thread_pool/_thread_pool_find_work_2.html (generated 2026-10-20).