Greg Beech's Website

Browse by Tags

  • Two common misconceptions regarding threading and events

    Events in .NET are a fairly simple programming model - you subscribe to an event and when it is raised your handler is called. There are two common misconceptions about .NET events though. The first is that people believe event handlers are run in a multi-threaded manner, when in fact they aren't. The second is that raising an event isn't affected by multi-threading issues, when in fact it...
    Filed under: ,
  • Implementing the lazy initialize singleton pattern with generics

    Generics are by far my favourite addition to .NET in version 2.0 - not least because I never have to write a strong typed collection again! But uses for them crop up all over the place. Recently I've been implementing a lot of classes with singleton instances, such as in configuration handlers, which use the initialize on first usage (lazy initialize) ideom and realized a generic class is the perfect...
    Filed under: ,
Copyright (C) Greg Beech. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems