I am using ReaderWriterLockSlim to protect cache access in my ASP.NET application. There are examples of using locks on MSDN. However, this article http://www.nobletech.co.uk/Articles/ReaderWriterLockMgr.aspx makes me worry about deadlocks. Is this really a risk? Should be mentioned in the MSDN documentation?
public string Read(int key) { cacheLock.EnterReadLock(); // What if thread abort happens here before getting into the try block?! try { return innerCache[key]; } finally { cacheLock.ExitReadLock(); } }
Sorry, I missed the reading earlier,
Is this attribute not specified?
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
Source: https://habr.com/ru/post/1718189/More articles:Pass parameter by reference between two forms - pass-by-referencea simple virtual system for delphi - should be FREE! - filesystemsQT installation error Installation error? - Snow Leopard - installerHow to make PHP command line work with PDO? - command-lineSpring destroy-method and half of the entered objects - springCSS line height does not affect Cufon fonts - cssIs there a way to intercept print jobs on a local Windows XP machine? - windows-xpAdding Rich Text to AcroField in iTextSharp - .netEmphasize the value of a form field using itextsharp - c #Printing using a template in flex - flexAll Articles