Date: 2007-04-11 11:26 pm (UTC)
I'd say that the bug and the idiom are independent. Having 'synchronized' without 'volatile' obviously was an idiocy, but why should I bother writing explicit synchronization incantations and runtime hints to initialize a singleton if the runtime already provides the mechanism. IBM (linked by [livejournal.com profile] upstartn) says the same thing:


Instead of double-checked locking, use the Initialize-on-demand Holder Class idiom, which provides lazy initialization, is thread-safe, and is faster and less confusing than double-checked locking[.]
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 14th, 2025 06:26 pm
Powered by Dreamwidth Studios