9 December 2011
Links on the singleton pattern
I'd been going to interviews over the past month and the singleton is still the most popular point of discussion. I would try to bring up other patters (let's discuss the visitor!) but to no avail. It's popular beyond its usefullness, and so I just hate discussions on it. However, it did force me to dredge up memories of discussions on the difficulties in managing the lifetime of a singleton in C++. The links:
- To Kill a Singleton John Vlissides' detailed analysis of the problem and possible solutions
- Double-checked locking - I'm embarrassed to say that I'd never heard of this (though may have used a form of it before). Check the singleton for construction and grab a lock if it needs constructed. Once getting the lock on an object, you have to re-verify that it needs constructed since it could have happened while you were obtaining the lock. Neat.
- Once Is Not Enough - Jim Hyslop and Herb Sutter's discussion on the similarities/differences of singletons and global variables
[ posted by sstrader on
9 December 2011 at 9:19:50 AM in Programming
]
- Techniques after using Swift for a month posted by sstrader on 26 August 2015 at 11:41:51 PM
- Some thoughts on Ruby after finishing a week (minus one day) of training posted by sstrader on 15 December 2011 at 8:59:30 PM
- Links on the singleton pattern posted by sstrader on 9 December 2011 at 9:19:50 AM
- Phonebot posted by sstrader on 29 October 2011 at 6:37:05 PM
- The labeled break in Java posted by sstrader on 4 September 2011 at 11:27:56 AM
Related entries
Other entries categorized in Programming: