0

With alle the new paralell programming features in .NET 4.0, what 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?

bitbonk
  • 48,890
  • 37
  • 186
  • 278

1 Answers1

2

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

Andrey Taptunov
  • 9,367
  • 5
  • 31
  • 44