public static class Program
{
internal static string Result(string ip)
{
// your function here
}
internal static void Main()
{
const int ParallelJobs = 100;
var ips = File.ReadAllLines("your.data");
var results = ips.AsParallel().WithDegreeOfParallelism(ParallelJobs ).Select(Result).ToList();
File.WriteAllLines("your.results", results);
}
}
Basically, that's it. Now it runs in parallel. Your jobs seem to be I/O bound with a lot of idle waiting time, so I would set the degree of parallelism quite high. "Waiting" can be done in huge batches :)