Next: Useful Macros and Constants, Previous: Memory Management, Up: MPIR Basics [Index]
MPIR is reentrant and thread-safe, with some exceptions:
alloca
is not available),
then naturally MPIR is not reentrant.
mpf_set_default_prec
and mpf_init
use a global variable for the
selected precision. mpf_init2
can be used instead, and in the C++
interface an explicit precision to the mpf_class
constructor.
mp_set_memory_functions
uses global variables to store the selected
memory allocation functions.
mp_set_memory_functions
(or malloc
and friends by default) are
not reentrant, then MPIR will not be reentrant either.
fwrite
are not reentrant then the
MPIR I/O functions using them will not be reentrant either.
gmp_randstate_t
simultaneously,
since this involves an update of that variable.