I have a MonoTouch application that uses ThreadPool to control the number of background threads. If I have a ThreadPool that creates a thread and inside the thread, it runs the Async web request, will the web request appear in the second thread? if so, will this thread be removed from ThreadPool?
What is the best practice for such a thing? Should a web request simply be a synchronous call to reduce the current thread count?
ThreadPool.QueueUserWorkItem(callback =>
{
WebClient client = new WebClient();
client.DownloadStringAsync(new Uri("http://www.google.com/"));
client.DownloadStringCompleted += (a,b) => Console.WriteLine("Done");
});
source
share