How to: Parallel.ForEach vs Task.Factory.StartNew
Parallel.ForEach vs Task.Factory.StartNew
What is the difference between the below code snippets? Won’t both be using threadpool threads?
For instance if I want to call a function for each item in a collection,
Parallel.ForEach<Item>(items, item => DoSomething(item)); vs foreach(var item in items) { Task.Factory.StartNew(() => DoSomething(item)); }
Answer: Parallel.ForEach vs…
View On WordPress













