[PATCH 1/1] Get rid of synchronization in java.util.logging.LogRecord constructor
martinrb at google.com
Thu Mar 12 17:37:41 PDT 2009
On Thu, Mar 12, 2009 at 17:21, Andrew John Hughes
<gnu_andrew at member.fsf.org> wrote:
> I agree. I also noticed that Thread uses a synchronised block to do
> the increment rather than the atomic. I don't know if there'd be any
> advantage to changing it or whether there is a good reason it was done
> like that.
java.lang.Thread should utilize Atomics for global counters
I tried to replace the use of static synchronized with Atomics in Thread.java,
but there was a circular static initialization dependency, so I gave up.
David Holmes, you might want to close 6741261as Will Not Fix.
Or Andrew, you might want to prove me wrong and implement it properly.
It's probably not worth it - thread creation is going to be slow no matter what,
so the global lock is unlikely to be contended.
More information about the core-libs-dev