Multithreading in ASP.NET Site

Fork501

Freshman
Joined
Jan 27, 2007
Messages
41
Location
Weston, Florida
I have done work in the past with Multithreading in Java, so I always assumed it would be the same for C# (Well, not taking Syntax and methods into consideration).

Anyhow, I have a website, which needs to validate a guest's e-mail. I have that working just fine.

When the guest starts filling out my form, they enter all of their information and press a 'continue' button. At that moment, I use Javascript to use a post-behind to connect to the page, which does the actual e-mail validation. If their e-mail is valid, it is entered into a guest database.

In order to prevent the guest from waiting for the post-behind page to validate their E-Mail address, which could take upward of a minute, I am using my post-behind page to start a new thread and do all of the validation from there.

The underlying problem is that I have noticed crashes in IIS ever since I have launched this application. If I make any changes to the website and update a file (or even look at system settings), my whole website goes down for a few minutes. Sometimes, I don't even need to be poking around the server for it to happen. When I check my logfiles, I usually see an error stating that my Application Pool has terminated unexpectedly. I also have seen an error stating that there's a deadlock on aspnet_isapi.dll (I'm sorry that I can't C&P the error.. I can't seem to locate the last occurance iny my logfiles right now..)

Has anyone else experienced system problems after implementing multithreading?

I had originally thought that it was a server performance issue, but I'm running 3.05GHZ with 3.75GB of RAM. I have about 10 websites running on the server, but none of them share this application pool and none of them are memory-intense. They are basically there as static pages.

Thanks in advance!

~Derek
 
Hi,

Some thoughts:

If you edit the web.config file for the website, the app pool gets restarted...i don't know if that's the settings you are talking about.


Im assuming a post-behind is using the XmlHttpRequest object or equivalent.
A post-behind in essense should be an asynchronous request, therefore it spawns a thread implicity and you have no need to spawn another one.

If this is not the case, you need to be more specific in the post-behind process you are using.


As for the locking errors, I would assume that errors would come up if the user navigates to a seperate page and the spawned thread is still running.
 
Hi,

Some thoughts:

If you edit the web.config file for the website, the app pool gets restarted...i don't know if that's the settings you are talking about.


Im assuming a post-behind is using the XmlHttpRequest object or equivalent.
A post-behind in essense should be an asynchronous request, therefore it spawns a thread implicity and you have no need to spawn another one.

If this is not the case, you need to be more specific in the post-behind process you are using.


As for the locking errors, I would assume that errors would come up if the user navigates to a seperate page and the spawned thread is still running.

Thank you for your response!

By settings I meant when I right-click on the website, goto properties, click the ASP.NET tab and click on "Edit Configuration". I didn't know that the whole app pool would have to restart for that. Usually, when I restart an app pool, I am down for MAXIMUM 1 minute. This takes the site down for about 10 minutes.

By Post-Behind, I mean that I'm using the HTTPWebRequest and HTTPWebResponse objects in ASP.NET. I couldn't get it to do anything if I just used the HTTPWebResponse object for some reason, so I had to throw the request in there, as well. This is probably where my problems all reside.. I should take a look into how I'm doing this.

Sorry about not being specific with my terminology; I have a bad habit of using words to describe things and forgetting that not everyone else uses the same terms :o

Thank you again for your response, I greatly appreciate the insight! I will take a deeper look into how I am going about everything and see if changing some of my theory about how it should work will help resolve the issue.

~Derek
 
Last edited:
Back
Top