Created
July 9, 2012 16:31
-
-
Save DominicFinn/3077469 to your computer and use it in GitHub Desktop.
Parallel Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace ParallelLibrary | |
{ | |
public class FoolCollector | |
{ | |
public List<Fool> ChainOfFools { get; set; } | |
public void Collect() | |
{ | |
var fools = new List<Fool>() | |
{ | |
new Fool("Jim"), | |
new Fool("Bexley"), | |
new Fool("Lister") | |
}; | |
ChainOfFools = new List<Fool>(); | |
Parallel.ForEach(fools, ChainOfFools.Add); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment