CHAPTER 19 MULTITHREADED, PARALLEL, AND ASYNC PROGRAMMING
private string[] FindTenMostCommon(string[] words)
{
var frequencyOrder = from word in words
where word.Length > 6
group word by word into g
orderby g.Count() descending
select g.Key;
}
string[] commonWords = (frequencyOrder.Take(10)).ToArray();
return commonWords;
private string FindLongestWord(string[] words)
{
return (from w in words orderby w.Length descending select w).FirstOrDefault();
}
If you were to run this project, the amount of time to perform all tasks could take a goodly amount
of time, based on the CPU count of your machine and overall processor speed. Eventually, you should
see the output shown in Figure 19-4.
Figure 19-4. Stats about the downloaded e-book
You can help ensure that your application makes use of all available CPUs on th