473,756 Members | 3,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Threadi ng.ThreadAbortE xception' 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 executionTimeou t="30000"/>

</system.web>
it does not help.

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

1 System.Threadin g.Thread acceptThread;
2 acceptThread = new
System.Threadin g.Thread(Pool.T hreadPoolManage ment.ThreadPool Init);
3 acceptThread.Is Background = true;
4 acceptThread.Pr iority = System.Threadin g.ThreadPriorit y.Normal;
5 acceptThread.Na me = "ThreadPoolBasi c";
6 acceptThread.St art();
so its even have a specific thread for itself. the pool is static
defined:

1 private static COM.Pool.Thread Pool 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.Thread Pool(min,max,"P ool1");
10 pool.DynamicThr eadDecay = 1000;
11 pool.Priority = System.Threadin g.ThreadPriorit y.AboveNormal;
12 pool.NewThreadT rigger = 100;
13 }
14 if (!pool.IsStarte d)
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.RuntimeM ethodHandle._In vokeMethodFast( Object target,
Object[] arguments, SignatureStruct & sig, MethodAttribute s
methodAttribute s, RuntimeTypeHand le typeOwner)
at System.RuntimeM ethodHandle.Inv okeMethodFast(O bject target,
Object[] arguments, Signature sig, MethodAttribute s methodAttribute s,
RuntimeTypeHand le typeOwner)
at System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean skipVisibilityC hecks)
at System.Delegate .DynamicInvokeI mpl(Object[] args)
at System.Delegate .DynamicInvoke( Object[] args)
at
MergeSystem.Ind exus.Common.Poo l.ThreadPool.Th readWrapper.Thr eadProc()
in D:\Dev\......Fi lePath.......\T hreadPool.cs:li ne 926

thank you very much in advance for any help.

kind regards,
roni

Feb 3 '07 #1
0 1666

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

Similar topics

1
2320
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 secondary-thread, it raised a exception. Then debugging and tracking the code, I found the problem was from the function pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) in . The parameters are (ADODB.Connection, None, 21,...
2
1815
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 times and notify the main thread it has finished by clearing a mutex before exiting. The main thread will simply check verify the final result in the global shared counter, wait for each worker thread has notify finishing, and exit.
5
11701
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, that the "recvFrom()" call should just continue blocking. Right? What I'm seeing is that when I send a packet to a particular address that is not responding, my "recvFrom()" call throws an exception. I get "An existing connection was forcibly...
3
3166
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: Message: The action being performed on this control is being called from the wrong thread. You must marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action. Stack Trace: at...
1
1925
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 clients to my tomcat server, this proxy is written in python, and i'm starting a new thread to handle (redirect) the requests whenever there's a new client connected to my proxy. Each handler thread will read the http request line from the client...
6
2362
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 problem also with other imports (e.g. urllib2 etc.). And again very often in all these cases where I get weired Python exceptions, the problem is around re-functions - usually during re.compile calls during import (see some of the exceptions below). But...
19
1595
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" class immediately after the above call, and invoke the above again as soon as the thread starts, it now returns null instead. Can anyone explain this. Thanks.
4
1223
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 = {'a': 1, 'b': 2, 'c': 3}
5
1564
by: A.Gallus | last post by:
This is my problem: I have two classes A and B: class A { void methodA(); } class B
2
4546
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 Backgroundworker1.RunWorkerAsync(). So far so good, this works fine. But when the process is done, I want to wait 30 minutes and then run the process again. So I added a System.Windows.Forms.Timer component to the form and in the Backgroundworker1_RunWorkerCompleted...
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9273
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10032
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9841
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9711
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7244
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5141
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5303
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.