Avoid concurrency issues with consumer / producer classes : <p>So, I'm building an console application that has a List of objects. </p>

<ul>
<li><p>Every 1000ms, a "producer" is doing a HTTP request and creating a new object from the result, and adds it to the List of objects.</p></li>
<li><p>Every 1000ms, a "consumer" is going analysing through all the objects in the list.</p></li>
<li><p>Every 2000ms, another "consumer" is going analysing through all the objects in the list.</p></li>
<li><p>Every 3500ms, another "consumer" is going analysing through all the objects in the list.</p></li>
</ul>

<p>Once in a while, at arbitrary times, I want to ask one of the consumers what the result of this analysed data is. </p>

<p>So this sounds like a classic producer / consumer pattern. In JavaScript this wouldn't be a problem, since it's nonblocking. But how about C#? I would assume this could be quite a concurrency nightmare. As far as I can understand, this cannot be done simply with Tasks, since you cannot control whether it is running in the same thread context, or a new thread. </p>

<p>I'm looking for the "simplest" way to do accomplish the case above. I've looked into things like TPL Dataflow, also considered a pattern doing a simple "event loop" with deltatime (like in video games), what are your suggestions?</p>

<p>Best regards,</p>
