FLINT3.7.0-dev

flint_set_thread_affinity, flint_restore_thread_affinity

Synopsis#include <flint/thread_support.h>
int flint_set_thread_affinity(int * cpus, slong length)source
int flint_restore_thread_affinity(void)source

Pin the master thread to cpus[0] and the global pool's threads to cpus[1], ..., cpus[length - 1], or restore the original affinity. Return 0 on success and nonzero on failure, including when the global pool does not exist yet.

Cite this page

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