[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-3671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norbert Kalmár updated ZOOKEEPER-3671:
--------------------------------------
    Fix Version/s: 3.7.0

> Use ThreadLocalConcurrent to Replace Random and Math.random
> -----------------------------------------------------------
>
>                 Key: ZOOKEEPER-3671
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3671
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.7.0
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> {quote}
> *_ThreadLocalRandom_ is a combination of 
> _[ThreadLocal|https://www.baeldung.com/java-threadlocal]_ and _Random_ 
> classes, which is isolated to the current thread.* Thus, it achieves better 
> performance in a multithreaded environment by simply avoiding any concurrent 
> access to the _Random_ objects.
> {quote}
> https://www.baeldung.com/java-thread-local-random
> I also had a conversation with a Oracle Java engineer that indicated that 
> {{ThreadLocalRandom}} is preferable with new development.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to