ASP.NET Threadpool

G

Guest

I am trying to create a page where multiple requests are made to a single
webservice. This webservice takes a fair amount of time to process the
requests so rather than making the calls one at a time I'd like to create a
new thread for each call. I tested this in a stand alone application with no
problems at all.

My problem is that when I try using the System.Threading.Threadpool class
inside the aspx page, nothing happens. I add a new thread using
ThreadPool.QueueUserWorkItem() and then check the available worker and
completion threads before and after with no change. I've also tried doing
this using the System.Threading.Thread class and have the same problem where
the thread doesn't start.

I was wondering if there were some sort of permissions that needed to be set
on IIS 6.0 to get this to work properly.
 
S

Scott Allen

Hi Johnathon:

Can you show us the code? Checking the available threads might not be any
indication if the item is actually queued to run - did you try a breakpoint
inside the method for the worker thread to execute?
 
G

Guest

I know it's definitely something on the server, because when I try to run the
same code on my local machine it runs fine.

Dim Capsule As New ThreadCapsule(XML)
Capsule.Status = "Incomplete"
Capsules.Add(Capsule)
ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf
Capsule.Entry))

That's the code I'm using to set up each thread in the threadpool. I use
the Capsule.Status variable so I can check if it's completed or not.
 
A

Alvin Bruney [MVP]

you need tracing to find out if the thread actually is running. chances are
it is running but falling over dead inside the routine.
what is the thread function doing ( post some sample code)
 
G

Guest

The very first thing I do in the thread is append a note to a log file saying
it's started. The logging function works because I use it outside the thread
as well, but the note is never put into the log file.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top