-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document thread safety #95
Comments
I think that the library is thread-safe. When you create hundreds of Fairy instances in quick succession and you do not provide seed with I think that when you need to use this library by multiple threads and the performance matters, you should create Fairy instance per thread. Each instance should be created by different |
Upon further investigation, I found out that some parts of the library are not thread safe. I think that we should state in the README that each thread should use its own |
Please document if the library is thread-safe. I'm generating millions of test samples and want to know if I can safely reuse the same instance across threads. Also during prototyping, I use
Fairy
object as a Spring singleton bean - is it safe as well?Another question - if I create hundreds of
Fairy
instances in quick succession, will they produce different samples? Or maybe (due to the same random seed maybe?) I'll get duplicates?The text was updated successfully, but these errors were encountered: