First time using locks and a ConcurrentQueue. Does my code make any sense?

The code is here:

The function "ProducersOfDataCallThis" is called from multiple threads. My goal is that every single request is enqueued and processed in the order that they arrived. The processing can be done by any thread, just one thread at a time. If no two "ProcessObjectFromQueue" are running at the same time then it works.

(At first I was thinking I needed a BlockingCollection, but I guess thats for other purposes.)

Can someone more expierienced with threading look at the code and give some input? 🙂

by fluoroamine via /r/csharp

Leave a Reply