Synchronisation in .NET – Part 2: Racy Data Structures, Padding and False Sharing
In the previous blog post we saw how the lock() statement in .NET scales very poorly when there is a contention on a
data structure. It was clear that a performance logging framework that relies on an array with a lock on each member to
store data will not scale.
Today, we will try to quantify just how much performance we should expect to get from the data structure if we somehow solve locking. We will also see how the underlying hardware primitives bubble up through the .NET framework and break the pretty object oriented abstraction you might be used to.
Because we have already proven that ConcurrentDictionary adds to much overhead, we will focus on Array as the
backing store for the data structure in all future implementations.

