On Tue, 15 Nov 2022 20:46:43 GMT, Xubo Zhang <d...@openjdk.org> wrote:

>> Xubo Zhang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Update src/java.base/unix/classes/sun/security/provider/NativePRNG.java
>>   
>>   Co-authored-by: Andrey Turbanov <turban...@gmail.com>
>
> Hi [XueleiFan](https://github.com/XueleiFan)
> This shouldn't be the case unless there is a kernel bug. Multiple threads 
> using ThreadLocal to access /dev/random is just like multiple applications 
> accessing it.

Hi @xbzhang99,
Could you explain the problem you are trying to solve?
Random number generation is usually just a tiny fraction of a larger algorithm, 
and the SecureRandom instance is rarely contended outside of microbenchmark 
setting. And if it's not contended, users will only pay the cost of using a 
ThreadLocal for no real benefit.

-------------

PR: https://git.openjdk.org/jdk/pull/11069

Reply via email to