The only thing I can think of is to create your own timeout process.  IE...the main 
thread sets property of the child thread that is the timeout.  The child thread keeps 
checking the value against it's own timer variable and throws an exception to end the 
process. 

-----Original Message-----
From: Karim Tabbouche [mailto:karim.tabbouche@;VERIZON.COM]
Sent: Tuesday, November 12, 2002 10:08 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] multithreaded application


Hi
I am creating a multithreaded application and am having problems with
implementation.
Here how it should work.
In the main thread I will read an xml document and for each node create a
new thread using the thread pool, now this is the simple part.
The problem is that I have to timeout(or kill) a thread if the thread
doesn't finish it job in the timeout specified and if it doesn't then i
need to recreate the thread after timeout+1 minutes and then timeout+2 up
to the number of my retries and if i reach the maximum of retries and the
thread doesn't finish its job then i would raise an exception for that
thread.
The job that the thread has to do is call a webservice method and the info
about this webservice can be pulled from the database using the id
attribute in the xml doc.

Note that I should use the thread pool for all the worker threads.

<jobs>
 <job retry=3 timeout=2 id=4/>
 <job retry=3 timeout=2 id=3/>
 <job retry=1 timeout=2 id=6/>
 <job retry=2 timeout=2 id=8/>
</jobs>

Thanks,
Karim

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to