August 14, 2024
A couple of times recently we have had a requirement to lock on a named item. We have not required a distributed lock (either between app domains or between servers), simply an in memory lock on a specific item. There is no standard way to achieve this in .Net and getting the details correct is surprisingly difficult (as with all multi-threaded code) so I will share the two versions we came up with. Version 1 uses a standard Dictionary of […]