Can a thread time out?

  • Thread starter Thread starter Jonah Olsson
  • Start date Start date
J

Jonah Olsson

Hi,

I'm very new to threading in .NET, so bear with me :-)

I'm planning to build a mail sender application for my client to send out
newsletters to its customers. The application should be built to handle at
least 15,000 customers. Potentially 40,000, but then I would probably
consider using the hosting provider's Mailing List product and send it the
database table to be sent.

I suppose the best way of doing this is to call the sender function within a
separate thread, loop through all email addresses and use Thread.Sleep to
wait for the SMTP server to catch up every now and then during the send
process.

Since the client clicks the send button and then probably exits the site,
will this thread still be running or will it time out/die?

Thanks for any kind of suggestions or help!

Regards,
Jonah Olsson
 
Jonah,

With this potential volume of messages being sent, your best approach by far
is not to send the e-mails from your web application at all. Store the
message details and the recipient list to a database, then use another
application (which can easily be placed on another server or have multiple
instances running on multiple machines if necessary) to send out the actual
e-mails in batches of configurable size. This will allow you to better
control the volume issue and avoid crippling your web server with tasks that
have nothing to do with your web application UI.

HTH,
Nicole
 
Hi Nicole and thanks for your reply,

Yes, that's probably what I would do then. At what volumes should I consider
the other dedicated application? Or did you mean the current 15,000?

Jonah
 
I think 15000 is already plenty, particularly if you could have multiple
users submitting simultaneous/overlapping mailings. If you don't have
another machine handy for running the mailer app, you can always put it on
the web server for now. You'll be able to move it quickly and easily to
another machine when/if the need arises.

HTH,
Nicole
 
Back
Top