I have 1.N threads writing to a .net 4.0 ConcurrentDictionary. I have another thread which fires every 5 seconds (settable in app.config) to enumerate the dictionary, and potentially remove some items. I want to halt the write operations during the enumeration.
What would be the best primitive to synchronize these two operations. Any help would be appreciated.
Bob.