I have one WCF service and in one module i have to se开发者_运维技巧nd confirmation mails on every save of the records. I am planning to use asynchronize threading for sending the mails so that service performance does not get affected when mail is send.
My question is whether using threading in WCF is safe or it may impact its performance?
How many emails are you sending as part of a save? If it's only a small number (ie: 1), the threading isn't necessary. Sending mail from .net to a local SMTP server (which will handle the actual delivery) is very fast. The actual "work" of doing delivery is handled by the SMTP server and isn't something you need to worry about.
You can do it and it should work, but in this case IMO the simplest solution will give you the best (and most easily maintainable later) results.
精彩评论