on concurrent dictionaries
I recently fixed some simple race conditions at work, which were caused by devs who lack a full understanding of concurrency and misuse the ConcurrentDictionary from the standard library. It seems they have a vague sense that when multiple threads are involved, concurrency might be needed: the classic Dictionary isn’t suitable anymore. However, instead of reaching for a simple lock, they are swayed by the presence of ConcurrentDictionary and overlook the broader problem. My hope is that removing these structures from the library would force more people to naively yet correctly use locks and guard them from introducing bugs.