473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP.NET Threadpool

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.
Nov 19 '05 #1
4 2382
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/
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.

Nov 19 '05 #2
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.

"Scott Allen" wrote:
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/
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.


Nov 19 '05 #3
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)

--
Regards,
Alvin Bruney
"Jonathan Howard" <Jo************@discussions.microsoft.com> wrote in
message news:FE**********************************@microsof t.com...
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.

"Scott Allen" wrote:
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/
> 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.
>


Nov 19 '05 #4
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.

"Alvin Bruney [MVP]" wrote:
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)

--
Regards,
Alvin Bruney
"Jonathan Howard" <Jo************@discussions.microsoft.com> wrote in
message news:FE**********************************@microsof t.com...
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.

"Scott Allen" wrote:
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/

> 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.
>


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dan Battagin | last post by:
Is there a known bug with the interaction between the HttpWebRequest and the ThreadPool? I current spawn several HttpWebRequest's using BeginGetResponse, and they work for a while, using worker...
5
by: Duane Pressley | last post by:
I'm looking for someone to help me make sense of the results I'm observing when using the ThreadPool class in a COM-Interop scenario. Here's the set up: 1.. A classic ASP page instantiates and calls...
6
by: Max Adams | last post by:
Threads and ThreadPool's If I use a ThreadPool how can I tell when a thead in the threadpool has exited? I don't want to set a global member variable I would much rather be able to act on an...
1
by: doudou-shen | last post by:
I will use threadpool do some work with threadpool . but I haven't any information about it . who can help me! thank a lot
13
by: orekin | last post by:
Hi There I have been programming C# for a couple of months and am trying to master Threading. I understand that ThreadPool uses background threads (see code example in MSDN page titled...
10
by: Lenn | last post by:
Hello, I have always used a certain design pattern for multithreaded Windows app; Start new worker thread from UI thread, use events to notify UI threads when something happens, update UI...
3
by: Kevin | last post by:
Using this: http://msdn2.microsoft.com/en-us/library/3dasc8as(VS.80).aspx as an example I have a question concerning the reuse of objects. In the example 10 instances of the Fibonacci class...
5
by: =?Utf-8?B?RkxEYXZlTQ==?= | last post by:
I'm developing an application that gets data from 100 sources (via telnet connections, but you can think stock quotes from a webservice if you like). I was planning on using the thread pool (25...
3
by: UltimateBanoffee | last post by:
Hi, I'm using asp.net 2.0 and I have an understanding issue here! I don't quite understand when the available threads in the ThreadPool are ever used. The application I have running doesn't use...
7
by: =?Utf-8?B?cmJEZXZlbG9wZXI=?= | last post by:
The following is from a simple Windows application in VS2005, which has button1 and textbox1 dragged onto a form. In StartThreads(), I call ThreadPool.QueueUserWorkItem(), then call WaitOne()....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.