Are ASP.NET requests multi-threaded?

G

Guest

I assumed that requests to my app are multi-threaded in that is there are 2
browsers making requests at the same time, I could be in the middle of
responding to one when I get the next.

But what I am finding in my debugger is that if they are backed up, I still
get just one at a time. Is this just the VS 2005 integrated web server that
has this behavior?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Thanks for Mark's informative input.

Hi Dave,

I haven't done exact test under test server, however, I think it quite
straighforward to do a simple test. You can create a page and use
Thread.Sleep to thread for seconds to make it take long to return. After
that, you can open multiple browsers to access that page, you can print
out the threadID to see the threading behavior. IMO, test server is also
multi-threading based and will not process all the requests on a single
shared thread.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

John Timney \(MVP\)

If your two browsers are making requests from the same client (ie. a browser
and a new window of that browser) then you could be simply sharing the same
session and thus seeing blocking. Any methods or actions to an app with a
session requirement can block the session state access until the first
request completes, or it appears to be single threaded when in fact its two
requests from the same client.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
 
S

Steven Cheng[MSFT]

IIS hosted ASP.NET should always be multi-threaded and it will leverage
thread pool threads to process each coming requests. And I suppose the VS
2005 testserver will also use threadpool threads to process multi-requests
simultaneously. Anyway, you can simply use some long-run page to test the
exact behavior in test server.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top