难道BlockingCollection.GetConsumingEnumerable()删除项目项目、BlockingCollection、GetConsumingEnumerable

由网友(︻щμ風正dι垂)分享简介:有人可以证实,低于code肯定从BlockingCollection删除项目Can someone confirm that the below code definitely removes items from the BlockingCollectionforeach (var item in myColle...

有人可以证实,低于code肯定从BlockingCollection删除项目

Can someone confirm that the below code definitely removes items from the BlockingCollection

foreach (var item in myCollection.GetConsumingEnumerable())
{
  //Do stuff
}

它说,在 MSDN 的,它不会,但我只需要重新放心,因为我有一个近乎实时的应用程序接受输入到4这些藏品60ms的分开,过了一段时间我的应用程序被冻结,我不知道为什么,只是想以确保项目被删除。

It does say on MSDN that it does but I just need to be re-assured as I have a near real time application accepting inputs into 4 of these collections 60ms apart and after a while my app is freezing and I dont know why and just wanted to be sure that items are being removed.

推荐答案

在文档说:

返回值:   一个IEnumerable说的删除的,并从集合返回项目。

Return value: An IEnumerable that removes and returns items from the collection.

(强调)

阅读全文

相关推荐

最新文章