Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
ThreadLocalRandom is a combination of 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.
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.
Attachments
Issue Links
- links to