[PATCH 1/1] Get rid of synchronization in java.util.logging.LogRecord constructor
Martin Buchholz
martinrb at google.com
Fri Mar 13 00:37:41 UTC 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
Category
http://bugs.sun.com/view_bug.do?bug_id=6741261
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.
Martin
More information about the core-libs-dev
mailing list