public void Run(AdWordsUser user, long adGroupId)
{
const int NUM_THREADS = 100;
// Increase the maximum number of parallel HTTP connections that .NET
// framework allows. By default, this is set to 2 by the .NET framework.
System.Net.ServicePointManager.DefaultConnectionLimit = NUM_THREADS;
List<Thread> threads = new List<Thread>();
for (int i = 0; i < NUM_THREADS; i++) {
Thread thread = new Thread(new KeywordThread(user, i, adGroupId).Run);
threads.Add(thread);
}
for (int i = 0; i < NUM_THREADS; i++) {
threads[i].Start(i);
}
for (int i = 0; i < NUM_THREADS; i++) {
threads[i].Join();
}
}