开发者

Implementing the procducer-consumer pattern with .NET 4.0

开发者 https://www.devze.com 2023-01-01 21:45 出处:网络
With alle the new paralell programming features in .NET 4.0, wh开发者_开发问答at would be a a simple and fast way to implement the producer-consumer pattern (where at least one thread is producing/enq

With alle the new paralell programming features in .NET 4.0, wh开发者_开发问答at would be a a simple and fast way to implement the producer-consumer pattern (where at least one thread is producing/enqueuing task items and another thread executes/dequeues these tasks). Can we benfit from all these new APIs? What is your preferred implementation of this pattern?


Implement IProducerConsuerCollection or derive from BlockingCollection. Samples are provided in the documentation for these items.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号