I have data that sends in "bursts" of 100 records with a significant delay. How do I structure my classes for multithreading?

Posted by makerofthings7 on Programmers See other posts from Programmers or by makerofthings7
Published on 2012-10-18T23:00:06Z Indexed on 2012/10/18 23:16 UTC
Read the original article Hit count: 199

My datasource sends information in 100 batches of 100 records with a delay of 1 to 3 seconds between batches.

I would like to start processing data as soon as it's received, but I'm not sure how to best approach this.

Some ideas I've been playing with include:

  • yield
  • Concurrent Dictionary
  • ConcurrentDictionary with INotifyProperyChanged
  • Events
  • etc.

As you can see I'm all over the place, and would appreciate some tested guidance on how to approach this

© Programmers or respective owner

Related posts about c#

Related posts about data-structures