Does this seem like a reasonable approach to a concurrent set/queue combo?
问题 Update : As Brian pointed out, my original idea did indeed have a concurrency issue. This was somewhat obscured by the signature of the ConcurrentDictionary<TKey, TValue>.AddOrUpdate method, which can lull a lazy thinker (like myself) into believing that everything--the set add as well as the queue push--will somehow happen all at once, atomically (i.e., magically). In retrospect, it was foolish of me to have this expectation. In fact, regardless of the implementation of AddOrUpdate , it