RFR (S): CR 8005926: (thread) Merge ThreadLocalRandom state into java.lang.Thread
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed Jan 16 10:37:50 UTC 2013
On 01/16/2013 01:23 PM, Peter Levart wrote:
> The test I used is simple:
> https://raw.github.com/plevart/lambda-hacks/master/jdk-test/src/org/openjdk/tests/java/util/concurrent/atomic/RandomTest.java
OK, you can't get serious with that test. The failures visible at the
surface are:
- dead-code elimination for parts of nextInt(): you should consume the
results!
- thread start/stops are not synchronized; there are significant
chances threads are running solo for considerable amount of time.
This should be much easier to write once our microbenchmark harness goes
into OpenJDK; in the mean time, you will need to invest considerably
more time into making this right.
-Aleksey.
More information about the core-libs-dev
mailing list