So, last time I talked a bit about lock-free data structures. Here’s the second part, as promised.
I’m not going to go into great detail on the topic (unless people seem interested), and there’s plenty of other pages and sites dedicated to it. But I just wanted to share this little class I made. I [...]
As part of my day job, I’m always striving towards higher performance code while at the same time trying to retain a readable and flexible design (since customers are always changing what they want).
One of the big killers of performance is locks — they’re the most basic way to ensure mutual-exclusion of shared data [...]
WARNING: As discussed in the comments, this collection class uses weak events, and (due to a bug in the .NET framework itself) weak events are not reliable unless you’re using .NET 3.5 SP1 or higher. If you’re stuck with an earlier version of the framework (or don’t want to verify that end users have installed [...]