Random Generate & Thread Safety

james at jamesbb.co.uk james at jamesbb.co.uk
Thu Nov 17 20:34:11 CET 2011


Hiya,
 
I understand that the random integer functions are not thread-safe.
 
To achieve thread-safety, is it sufficient to keep the gmp_randstate_t structure
in thread-local storage?
 
I'm unsure about what's going on 'under the hood' which these functions, and
whether they could get in each others way even if they're operating on different
gmp_randstate_t structures..
 
Any advice is appreciated!
 
Cheers
James 


More information about the gmp-discuss mailing list