As Tigran said, the challenge of the event is serial. Even more, if one of the subscribers throws an exception at some point, the rest of them will not be launched.
The easiest way to trigger a parallel event is
public event Action Event;
public void Trigger()
{
if (Event != null)
{
var delegates = Event.GetInvocationList();
Parallel.ForEach(delegates, d => d.DynamicInvoke());
}
}
This implementation will suffer from the same problem in the event of an exception.
source
share