Andrew Kalashnikov
Andrew Kalashnikov

Reputation: 3173

Using threadpool at asp.net

There is web-handler(high-load) at my asp.net application which should call several(2,3) requests to independant web-services get some results from it, combine it and send complex result to user.

For parallel consuming web-services I'm going to use ThreadPool. Is it a good idea?

Oh may be I should create threads manually?

Thanks for answer.

Upvotes: 0

Views: 80

Answers (2)

Dave Walker
Dave Walker

Reputation: 3523

As sJhonny said you really don't want to be dealing with Threads in ASP.Net. There are many hooks into getting this working correctly though.

Look at http://weblogs.asp.net/gunnarpeipman/archive/2010/09/07/making-asynchronous-calls-to-web-services-during-asp-net-page-processing.aspx

In this the Asynchronous page model will handle 99% of what you will ever need.

Upvotes: 2

J. Ed
J. Ed

Reputation: 6742

actually when several requests arrive simultanuosly, the asp.net engine knows to create a different thread for each of them without any involvment from your side.
so, unless there's some special need for you to create threads yourself- I would advise against it.

actually, if an uncaught exception is raised in a thread, it might cause the entire worker process to shut down, thus bringing down your whole application.

Upvotes: 1

Related Questions