C#C
C#3y ago
ав

❔ What is the best approach for a process ConcurrentQueue?

I have a ConcurrentQueue which is filled by different threads. There is also a class that should, while there are elements in the queue, get the front one and process it. What is the best way to implement this? I only have this idea: In a loop with a timer, check if there are elements in the queue and if so, start processing the queue. Is there a better approach?
Was this page helpful?