asuhan commented on pull request #11864: URL: https://github.com/apache/arrow/pull/11864#issuecomment-998176473
> The two-stage proposal avoids the cost of calling `random_device` everytime the "random" function is called. This is my current understanding of your proposal: 1. Once per process: Generate entropy bits, from a call to `random_device`. 2. Once per process: Instantiate a seeding generator, for those entropy bits. 3. For each call to `random`: Instantiate a new random generator, using the seeding generator from step 2 for the seed. If that's correct, we still need the seeding generator to be thread safe. I don't think PCG is thread-safe, so we'd still need to instantiate one per thread (or lock, but is that better?). With that in mind, it's not clear to me how we could avoid making it thread local. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
