News for hackers. Stuff that matters.
Re:Safe Publication and Safe Initialization in Java by gresrun on Sunday September 28, 2014 @04:54PM (#8380877)
Not sure, but their margins of error overlap so it could be just a blip. I wouldn't read too much into those numbers; my take away is I always preferred Safe DCL but Holder looks more performant and cleaner to write (at the cost of an inner class).

I wish Java had a one-true-way for one-time static initialization like dispatch_once() in Objective-C.

Re:Safe Publication and Safe Initialization in Java by nobullet on Sunday September 28, 2014 @05:21PM (#8380932)
You are right: it would be great to have one good approach. By the way, holder solves the problem when you don't need to pass arguments to singleton instance. In other cases Safe DCL, Safe Local DCL or Synchronized CL will work.