Hai guys,
I had the following code to send different mails to differnt users in my asp.net web application
foreach (DataRow dataRow in dataTable.Rows)
{
sendMails();
}
public void sendMails()
{
//mail code
}
Now i want to use threads inside foreach loop, but i dont know what would be the result because if i start 'n' number of threads what happens to the thread pool.. Consider my datatable contains 1000 rows,
Is it possible to have 1000 threads running concurrently?
foreach (DataRow dataRow in dataTable.Rows)
{
ThreadStart ts1 = new ThreadStart(sendMails);
Thread thread1 = new Thread(ts1);
thread1.Start();
}
public void sendMails()
{
//mail code
}