C#/.NET Fundamentals: Safely and Efficiently Raising Events(www.blackrabbitcoder.net)
submitted by
BlackRabbitCoder(661) 5 months, 24 days ago
A couple of posts ago, I discussed the EventHandler<TEventArgs> and EventHandler delegates, and in particular at one point mentioned in a sidebar that you need to watch out for thread-safety in order to safely raise events in a multi-threaded environment.
There was an interesting discussion in the comments about different ways that people achieve their thread-safety when raising events, and that got me interested in exploring them more in detail and checking them for performance.
This post examines several ways to raise events in a thread-safe manner, and compares the performance aspects of each.
|category: C#
|Views: 30
tags:
C# another
Everyones tags:
Your Tags: