all groups > dotnet web services > january 2008 >
You're in the

dotnet web services

group:

multi tasking?


multi tasking? cj
1/25/2008 4:10:55 PM
dotnet web services: Strictly as an example, suppose I write a web service that takes an
employee number and then does some processing and returns their security
clearance, name, department or some such stuff. Again for arguments
sake say this processing takings about 15 seconds each time. Lastly
assume there are lots of people making inquiries via this web service
and at some times of the day we get a request every 2 or 3 seconds. Can
a web service start a new request if it hasn't finished the previous
one? Is it multi-tasking or multi-threaded by nature or is there
something I need to do to allow it to do this? The object is nobody
should have to wait for a previous request to finish for their request
to start.
Re: multi tasking? John Saunders [MVP]
1/25/2008 4:16:20 PM
[quoted text, click to view]

ASP.NET will start a new worker thread per request.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Re: multi tasking? cj
1/25/2008 4:22:40 PM
Excellent. I had hoped it would. Now bear with me a minute. If part
of the processing is to make a sql connection and look up data, I'd
assume that each thread would make it's own connection--correct?


[quoted text, click to view]
Re: multi tasking? Spam Catcher
1/25/2008 9:37:57 PM
cj <cj@nospam.nospam> wrote in news:Ov$krh5XIHA.4684@TK2MSFTNGP06.phx.gbl:

[quoted text, click to view]

Correct - each web service connection will request a new sql connection
from the sql connection pool.

However, you could use child threads to increase concurrency - but
depending on your application, the performance may or may not increase.

--
Re: multi tasking? Dave
1/25/2008 10:30:45 PM
just remember though, somewhere everything has to add up or you will run out
of one resource or another. having the web app run multi-threaded so users
don't have to wait for it is fine, but if each query still takes 15 seconds
from the database it has to be able to handle the multiple simultaneous
requests also. if the database server can't handle a request every 2 or 3
seconds eventually you will not be able to connect, it will crash, or
something else bad will happen.

[quoted text, click to view]

Re: multi tasking? cj
1/26/2008 11:31:12 PM
This is just an example.

[quoted text, click to view]
Re: multi tasking? stcheng@online.microsoft.com
1/28/2008 4:20:49 AM
Hi Cj,

ASP.NET webservice use the same threading model as ASP.NET webform
application. ASP.NET runtime pickup a worker thread from .NET clr
threadpool to process each comming request and release it back to the pool
after finishs the request. Here is a very good reference about ASP.NET
threading model:

#Microsoft ASP.NET Threading
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/en/tra
nscripts/wct060503.asp

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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






--------------------
Date: Sat, 26 Jan 2008 23:31:12 -0500
From: cj <cj@nospam.nospam>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Subject: Re: multi tasking?


This is just an example.

[quoted text, click to view]
AddThis Social Bookmark Button