<p>Something that confuses me, but has never caused any problems... the recommended way to dispatch an event is as follows:</p>

<pre><code>public event EventHandler SomeEvent;
...
{
    ....
    if(SomeEvent!=null)SomeEvent();
}
</code></pre>

<p>In a multi-threaded environment, how does this code guarantee that another thread will not alter the invocation list of <code>SomeEvent</code> between the check for null and the invocation of the event?</p>

The recommended way is a little different and uses a temporary as follows:
```
```
EventHandler tmpEvent = SomeEvent;
if (tmpEvent != null)
{
    tmpEvent();
}
```
```