I got a recent interview Question regarding less expensive type of locking in C#, I described a singleton and they asked my about threading issues, I stated that because the singleton had a single static instance I would have to use lock(someref) for the get property which returns it singleton instance. They then told me that doing a lock on every get would be expensive so what would be a cheaper alternative to locking on the get instance property for the singleton class.]
Anyone know ?
Anyone know ?
Comment