【发布时间】:2012-07-26 14:14:04
【问题描述】:
我正在构建一个简单的 ASP.NET 网站,它将通过 3rd 方 SMS API(通过 URL 推送)接收 SMS,然后网站将通过向发件人发回 SMS 来确认发件人.我将传入的短信保存在数据库中。我已经实现了如下逻辑:
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//declaring variables to be used elsewhere, but in this same class. I have just this one class.
//Grabbing the URL parameters here (contents of SMS).
//Saving SMSes in the database. Database interaction happening only inside Page_Load.
//Call these functions
SomeLogicFunction();
SendSMSFunction();
}
SomeLogicFunction()
{
}
SendSMSFunction()
{
}
}
现在,我在某处读到 ASP.NET 处理多线程和类似方面。那么,如果我有这样一个简单的网站,我是否需要处理多线程?还是 Page_Load 函数/ASP.NET 几乎可以自动处理它?
如果答案是我不需要做任何事情,那就太棒了! 但是,如果我必须处理多线程,您能否提供一些关于我应该如何处理的提示?我预计会有几千条短信。
谢谢。
【问题讨论】:
-
“处理多线程和类似的方面” - 这是非常通用的。 ASP.NET 允许多个并发请求,但这并不意味着它“处理多线程”——例如,单个请求可能需要多个线程,而 ASP.NET 不对此负责。
标签: c# asp.net multithreading web-applications