using System.Collections.Generic;
public static void Main()
List<string> addresses = GetEmailAddresses();
TimeSpan period = TimeSpan.FromSeconds(1);
var timer = new System.Threading.Timer(e =>
foreach (string address in addresses.Skip(skipCount).Take(takeCount))
SendEmailAddress(address);
Interlocked.Add(ref skipCount, takeCount);
}, null, TimeSpan.Zero, period);
while (addresses.Count > Interlocked.CompareExchange(ref skipCount, int.MinValue, int.MinValue)) {
Console.WriteLine("Fine");
private static List<string> GetEmailAddresses()
return new List<string> { "a", "b", "c" };
private static void SendEmailAddress(string email)