I was reading this question and noticed the OP was iterating a list to queue up items into a ConcurrentQueue.
ConcurrentQueue<TaskClass> cq = new ConcurrentQueue<TaskClass>();
for (int x = 0; x < TaskList.Count; x++)
cq.Enqueue(TaskList[x]);
Is this necessary?
Is there a way to either:
- Add a large number of objects to a ConcurrentQueue, or
- Simply convert/cast a typed List into a ConcurrentQueue