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