472,981 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

strange Thread-pool behavior behind WebService

since a few day's i'm running around the problem that I stocked with a
change i need to do. hopefully somebody here can give me a tipp which
will be usefull to solve my problem.

I'm using a thread-pool within my WebSite which done some requests to
several interfaces the readed data will be added to the cache. This
operations consumes much CPU and I want to have this outside my
website so i decided to change the flow.

It should looks now like this:

User Request -Internal Call to DB to read needed Interfaces to
Invoke -Create Base Shared Cache Object and Add it to Shared Cache -
Call the WebService -Navigate to Result page
Thr result page will trigger the Website and the Code Behind triggers
the shared Cache to check if results already available.

All I have done so far is a new WebService Project which contains the
same references to the same Sub-Projects. With this i'm able to split
up the Invokes to the interfaces on a different machine if needed.

Now i'm able to execute exaclty the same code like it would be in the
WebSite. The only problem is that after several seconds ( normally
between 5 - 10 sec.) my Threads in the Pool are getting aborted :-
( from some unclear reason.

A first chance exception of type
'System.Threading.ThreadAbortException' occurred in mscorlib.dll <-
for each of my threads

in addition i see also this message:

The thread 0xa060 has exited with code 0 (0x0).

in the beginning i thought it will has to do something with a timeout
but even if I add the following lines to my web.config file:


<httpRuntime executionTimeout="30000"/>

it does not help.

The pool itself is initilized within a background thread from in the
Application_Start like this:

1 System.Threading.Thread acceptThread;
2 acceptThread = new
System.Threading.Thread(Pool.ThreadPoolManagement. ThreadPoolInit);
3 acceptThread.IsBackground = true;
4 acceptThread.Priority = System.Threading.ThreadPriority.Normal;
5 acceptThread.Name = "ThreadPoolBasic";
6 acceptThread.Start();
so its even have a specific thread for itself. the pool is static

1 private static COM.Pool.ThreadPool pool;
3 public static void ThreadPoolInit()
4 {
5 if(pool == null)
6 {
7 int min = 25;
8 int max = 32;
9 pool = new COM.Pool.ThreadPool(min,max,"Pool1");
10 pool.DynamicThreadDecay = 1000;
11 pool.Priority = System.Threading.ThreadPriority.AboveNormal;
12 pool.NewThreadTrigger = 100;
13 }
14 if (!pool.IsStarted)
15 {
16 LogHandler.Info("Call Pool1 pool.Start();");
17 pool.Start();
18 }
19 }
The exception i receive in my log file look like this:

Exception thrown performing callback:
Thread was being aborted.
at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target,
Object[] arguments, SignatureStruct& sig, MethodAttributes
methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
MergeSystem.Indexus.Common.Pool.ThreadPool.ThreadW rapper.ThreadProc()
in D:\Dev\......FilePath.......\ThreadPool.cs:line 926

thank you very much in advance for any help.

kind regards,

Feb 3 '07 #1
0 1619

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

Similar topics

by: WU FUHENG | last post by:
Today,I found a strange problem in python multi-thread programming.When I used function win32com.client.Dispatch('ADODB.Connection') in primary thread, it was OK. But when I called it in...
by: James Niceguy | last post by:
Hi, I have written a simple program that does the following: The main program will spown MAX_THREADS number of threads, each of which will simply add to a global shared counter for MAX_COUNT...
by: Terry | last post by:
It's my understanding of UDP sockets that if there is a thread blocked on a "recvFrom()" call and other thread sends a UDP packet to some address, that if the machine on the other end isn't up,...
by: MrNobody | last post by:
Ok, so I'm absoultely positive this was working last night, but today I'm getting this error in my program when I try to add a child node to a parent node of a tree... The error says: ...
by: liubojin | last post by:
Hi guys, I have got some strange system behaviors regarding i/o delays in socket in python, here's the details: I'm writing a web proxy like program that intercepts and redirects requests from...
by: robert | last post by:
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the...
by: Larry Smith | last post by:
Hi there, When I run the following on my app's primary thread: System.Type.GetType("System.Windows.Forms.Form") It works as expected. If I then launch a thread via the "BackgroundWorker"...
by: kj | last post by:
I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb. Here's an example: import sys, cjson d1 =...
by: A.Gallus | last post by:
This is my problem: I have two classes A and B: class A { void methodA(); } class B
by: Johnny Jörgensen | last post by:
I've got a process I want to run in a thread separate from my main application thread, so I've used a backgroundworker component, and in frmMain.Load I invoke the code using...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.