Severe bugs in SimplePriorityQueue example on MSDN
问题 I need to use a concurrent priority queue, and I was considering adapting the SimplePriorityQueue<TPriority, TValue> sample given in the How to: Add Bounding and Blocking Functionality to a Collection tutorial on MSDN. However, I was surprised at the severity of the bugs that the said sample seems to have. Could someone verify whether these issues are really present? 1) A race hazard exists between TryAdd and ToArray , which can cause an ArgumentException to be thrown from the latter. The