Hi everyone,
I've got a smaller problem which I can't get around of. I've seen some quite usefull answers around and was hoing someone might be able to help.
What I'm working on is a web application, which will be used for internal web service testing. All of it runs on c# .net 2.0. Currently I wanted to do some stress testing using multi-threading. Problem is I'm using threading iside web context.
To further complicate things, I'm also using AjaxPro (www.ajaxpro.info) to fire async requests. The web application is consuming a couple of different web services but that's not really the point. Everything is working fine and reliable up to where I try to run multiple threads to simulate multiple users/requests comming in to web services. I can't really use any of existing testing utilities since web services have a very specific headers and it needs to be constructed manualy.
Here's the problem:
Once a request comes in to the server side (through AjaxPro client call) a System.Threading.ThreadPool is used to que desired number of processes - each of those being a new instance of processing class. All of this works ok as well, the instance processes are being fired and those in turn fire off some events, cought by the same instance that loads the ThreadPool que.
One of the problems was you can't use HttpCOntext.Current.Session since there is no HttpContext inside child Threads. So I'm using external file storage to store thread progress. This part works ok now.
Biggest problem now is the client (browser) is not getting anything back once all the threads are fired, aldough I can clearly debug the main thread returning correctly.
I've done some isolated testing and processes loaded into ThreadPool should not block the main thread from ending execution. If you use ThreadStart -> Thread -> Start() routine, all of threads created that way block the main thread from finishing but using the ThreadPool should not block that.
Are there any more specifics about using multithreading inside http context I'm missing?