Thread & ConcurrentDictionary in C#
using System; using System.IO; using System.Text.RegularExpressions; using System.Threading.Tasks; public class Example { public static async Task Main() { string pattern = @"\p{P}*\s+"; string[] titles = { "Sister Carrie", "The Financier" }; Task<int>[] tasks = new Task<int>[titles.Length]; for (int ctr = 0; ctr < titles.Length; ctr++) { string s = titles[ctr]; tasks[ctr] = new Task<int>( () => { // Number of words. int nWords = 0; ...