Hacker News new | past | comments | ask | show | jobs | submit login

You can't seed each thread with the same value -- that's all you're saying, right?



Result distribution (like averaging to zero) only happens at scale. Even if you use a different seed every time you might not see the proper distribution when looking across different generator instances.


If you're running into contention with multiple threads on a shared PRNG, you're probably at sufficient scale.


Sure. Just saying that, for example, if you spawn threads and use the thread ID as the seed but pull a single value per thread, that's not sufficient.


Correct, you must use different, uncorrelated seeds for each thread if you want this to work. You can seed them all from one CSPRNG, for example, or from the Linux entropy service.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: