RFR: 8168640: (fc) Avoiding AtomicBoolean in FileInput/-OutputStream improves startup

Aleksey Shipilev shade at redhat.com
Tue Oct 25 11:09:16 UTC 2016


On 10/25/2016 12:51 PM, Claes Redestad wrote:
> Avoiding AtomicBoolean improves startup and footprint for a sample of
> small applications:
> 
> Webrev: http://cr.openjdk.java.net/~redestad/8168640/webrev.01/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8168640

I would generally disagree to avoid Atomics to improve startup. In this
case, we always lock on close(), even for a short time. I wonder if
using plain Unsafe.compareAndSwap instead of Atomic would be cleaner,
instead of introducing performance bugs with synchronized-s.

Thanks,
-Aleksey




More information about the core-libs-dev mailing list