using System.Threading.Tasks;
public static void Main()
var numbers = Enumerable.Range(0, 10);
Parallel.ForEach(numbers, i =>
var vm = VoteMachine.Instance;
Console.WriteLine(VoteMachine.Instance.TotalVotes);
private static readonly VoteMachine _instance = new VoteMachine();
private int _totalVotes = 0;
public static VoteMachine Instance
public void RegisterVote()
Console.WriteLine("Registered Vote #" + _totalVotes);