I am a bit of confused about Parallel.ForEach
.
What is Parallel.ForEach
and what does it exactly do?
Please don't reference any MSDN link.
Here's a simple example :
string[] lines = File.ReadAllLines(txtProxyListPath.Text);
List<string> list_lines = new List<string>(lines);
foreach (string line in list_lines)
{
//My Stuff
}
How can I rewrite this example with Parallel.ForEach
?
string[] lines = File.ReadAllLines(txtProxyListPath.Text);
List<string> list_lines = new List<string>(lines);
Parallel.ForEach(list_lines, line =>
{
//Your stuff
});