private static void UpdateCache(string projectName) { ProcessInformationList list = new ProcessInformationList(); foreach (Process process in ManagedProcesses[projectName]) { try { list.Add(new ProcessInformation(process)); } catch // Catches all the old dead processes so that the above list is updated with only live processes { } } LockCookie lockCookie = readWriterLock.UpgradeToWriterLock(100); try { ManagedProcessInformationListCache[projectName].ProcessInformationList = list; } finally { readWriterLock.DowngradeFromWriterLock(ref lockCookie); } }