Previous benchmark was measuring initialization of thread pools and their shutdown, not really measuring performance of Random.nextInt() shared Random instance vs ThreadLocalRandom.current() Example when run with 8 threads Benchmark Mode Cnt Score Error Units ThreadLocalRandomBenchMarker.randomValuesUsingRandom thrpt 20 9.597 ± 0.475 ops/us ThreadLocalRandomBenchMarker.randomValuesUsingThreadLocalRandom thrpt 20 2195.178 ± 109.579 ops/us
Core Java Concurrency Advanced Examples
This module contains articles about advanced topics about multithreading with core Java.
Relevant Articles:
- Semaphores in Java
 - Daemon Threads in Java
 - Priority-based Job Scheduling in Java
 - Brief Introduction to Java Thread.yield()
 - Print Even and Odd Numbers Using 2 Threads
 - Java CyclicBarrier vs CountDownLatch
 - Guide to the Fork/Join Framework in Java
 - Guide to ThreadLocalRandom in Java
 - The Thread.join() Method in Java
 - Passing Parameters to Java Threads