Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Created July 9, 2012 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominicFinn/3077469 to your computer and use it in GitHub Desktop.
Save DominicFinn/3077469 to your computer and use it in GitHub Desktop.
Parallel Class
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