Hello all,
I'm curious about the random number generators and how they can be
effectively used in different situations. I'm not particularly
experienced with large-scale or parallel programming, so bear with me if
what follows seems stupid.
My "typical" mode of use for the rng would be to create a module in my
program such as,
/*** myProg_rng.c ********************************/
#include <gsl/gsl_rng.h>
gsl_rng *myProg_rng;
/*** end of myProg_rng.c *************************/
/*** myProg_rng.h ********************************/
#include <gsl/gsl_rng.h>
extern gsl_rng *myProg_rng;
/*** end of myProg_rng.h *************************/
... which would store the rng to be used by any other part of my code.
Is this a sensible way to proceed or should I actually pass the rng
around between different functions? Could anyone comment on "good
practice" in using the rng?
The second question is, what if I want to use Pthreads or something
similar (which I'm just trying to teach myself)---do I have to do
anything to restrict access to the rng? The GSL documentation claims
that gsl is "thread-safe", but I don't know really what this means,
whether GSL will sort everything out with respect to different threads'
access of the rng, or whether I do have to take my own precautions.
Can anyone advise?
Thanks in advance for any comments,
-- Joe
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl