473,320 Members | 2,071 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,320 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:

<system.web>

<httpRuntime executionTimeout="30000"/>

</system.web>
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
defined:

1 private static COM.Pool.ThreadPool pool;
2
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 }
20
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)
at
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,
roni

Feb 3 '07 #1
0 1641

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

Similar topics

1
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...
2
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...
5
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,...
3
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: ...
1
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...
6
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...
19
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"...
4
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 =...
5
by: A.Gallus | last post by:
This is my problem: I have two classes A and B: class A { void methodA(); } class B
2
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.