you just need to be careful that you don't starve the threadpool by too many
asynchronous calls. Everything async uses a thread from the thread pool.
"Alvin Bruney [MVP - ASP.NET]" <
www.lulu.com/owc> wrote in message
news:#PMlDqDUFHA.544@TK2MSFTNGP15.phx.gbl...
> 1. not exactly, both pools are actually the same pool. there are 25 worker
> threads for asp.net and 25 more for IO related activities. That's it.
There
> aren't anymore available.
>
> 2. yes. the beauty of the thread pool is that once a queued item is thru
> servicing, it returns back to the pool.
>
> 3. see 1.
>
> 4. yes. call execution occurs sequentially from the main thread's
> perspective. If the sequential call fires an asynchronous object, it
simple
> returns. the async object then executes on its own thread. If the object
is
> not an async object, then the main thread waits for the completion of the
> call.
>
>
> 5. Yup. that's right.
> Quoting the docs:
> An array of type Object to pass as arguments to the given method. This can
> be a null reference (Nothing in Visual Basic) if no arguments are needed.
>
>
>
> --
> Regards,
> Alvin Bruney - ASP.NET MVP
>
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> Now available @
www.lulu.com/owc, Amazon.com etc
> "Stewart Rogers" <StewartRogers@discussions.microsoft.com> wrote in
message
> news:51626805-D7F6-4D10-9288-DD983F5F49EA@microsoft.com...
> > Thanks for your response Alvin but I still have some questions, mostly
> > regarding threading.
> >
> > (1) Looks like there will be two different thread pools involved when
> > using
> > remoting in ASP.NET. One pool would be ASP.NET worker thread pool
whereas
> > the
> > other one would be .NET remoting thread pool. am I right?
> >
> > (2) I understand that ASP.NET uses worker threads to service the HTTP
> > request and that thread comes from ASP.NET's own pool of threads. Is
that
> > thread returned to the ASP.NET worker thread pool after dispatching the
> > asynchronous call?
> >
> > (3) You said that "the called asynchronous code fires on its own
thread".
> > Who supplies that thread? ASP.NET worker thread pool or the .NET
remoting
> > thread pool?
> >
> > (4) You said that "The caller - main thread - moves on". I think you are
> > referring to the ASP.NET worker thread that invoked the component. am I
> > right?
> >
> > (5) You said "For asynchronous calls with callbacks, if there is nothing
> > to
> > call back to, nothing happens". That means if I pass null in both of the
> > parameters to BeginInvoke call then I should be ok. Any thoughts?
> >
> > I know these are quite a few questions to answer but a through/detailed
> > reply will help me understand the threading behavior.
> >
> > Thanks for your all of your help; I highly appreciate that.
> >
> > Stewart
> >
> > "Alvin Bruney [MVP - ASP.NET]" wrote:
> >
> >> ASP.NET handles threading the usual way. A thread from the pool is used
> >> to
> >> handle the request. A call, any call, executes the calling code.
> >> Asynchronous calls return immediately, the called asynchronous code
fires
> >> on
> >> its own thread. The caller - main thread - moves on. For asynchronous
> >> calls
> >> with callbacks, if there is nothing to call back to, nothing happens.
You
> >> have to be careful with callbacks and delegates because by the time
these
> >> calls get executed, the context may not be around resulting in a null
> >> reference exception.
> >>
> >> --
> >> Regards,
> >> Alvin Bruney - ASP.NET MVP
> >>
> >> [Shameless Author Plug]
> >> The Microsoft Office Web Components Black Book with .NET
> >> Now available @
www.lulu.com/owc, Amazon.com etc
> >> "Stewart Rogers" <StewartRogers@discussions.microsoft.com> wrote in
> >> message
> >> news:2C8E52BD-6E96-4CF9-A566-3E26E6257ED4@microsoft.com...
> >> > Hi all,
> >> > Now I know that we can call .NET remoting components asynchronously
> >> > from
> >> > ASP.NET pages and it works like a charm! But I am concerned about the
> >> > behavior of the overall system in this case and how does ASP.NET
handle
> >> > threads.
> >> >
> >> > (1) Lets say I asynchronously call .NET remoting component and
> >> > redirects
> >> > user to a page. What happens to the ASP.NET thread that called the
> >> > remoting
> >> > component asynchronously? Does that thread get stuck until the call
> >> > actually
> >> > completes or the thread aborts as soon as the HTTP request is
> >> > completed?
> >> >
> >> > (2) What if I pass null in the last two parameters (AsyncCalback and
> >> > object)
> >> > of the delegate BeginInvoke method?
> >> >
> >> > I tried passing null in last two parameters of the BeginInvoke call
and
> >> > it
> >> > works fine!
> >> >
> >> > What I am trying to figure out for sure is the "threading behavior"
in
> >> > case
> >> > of making asynchronous calls from ASP.NET pages because I don't want
to
> >> > do
> >> > anything that might affect the server threading because the
application
> >> > I
> >> > am
> >> > working is supposed to be hit by thousands of users and scalability
is
> >> > a
> >> > big
> >> > issues for me!
> >> >
> >> > Could you guys pls answer the above questions and throw some light on
> >> > the
> >> > ASP.NET threading and its behavior in case of asynchronous remoting.
> >> >
> >> > Thanks,
> >> > Stewart Rogers
> >>
> >>
> >>
>
>