How do I implement my own advanced Producer/Consumer scenario?

前端 未结 5 1827
无人共我
无人共我 2021-01-24 00:56

NOTE:
i did a complete rework of my question. you can see the original question via the change-history.


i\'m in the need of a "mighty&qu

5条回答
  •  [愿得一人]
    2021-01-24 01:33

    If you have .Net 4.0, use a BlockingCollection. It deals with all the mess for you, including the final point, via the CompleteAdding method.

    If you have an earlier .Net, then upgrade (i.e., I'm too lazy to explain how to implement something that has already been done for you.)

    EDIT: I don't think your problem warrants threading at all. Just create all the emails well in advance and then sleep till the appointed time.

提交回复
热议问题