On 01/08/13 11:07, Chris Hegarty wrote:
Doug,

I have no objection as such to adding certain fields to j.l.Thread to support
faster ThreadLocalRandom. Maybe it would help to see how they are to be used?

Sorry, it just occurred to me that you surely meant:
how would these Thread fields be used in ThreadLocalRandom.
here's the basic plan:

1. There is a singleton TLR that is always returned by TLR.current
after first checking (via nonzero probe) if initialized for
this thread.

2. On a call to next() etc, this object accesses and updates
threadLocalRandomSeed using Unsafe (to bypass access control).

-Doug


Reply via email to