Hi Iceman,
Thank you for your reply.
If I set the timeout property and the thread does throw an exception. Am I
able to restart the exactly the same thread?
I think this due to how you handle the exception, when you run the thread,
the thread must has change the state of some variables or some other
resource, so you should reset them properly so that when the thread
restart, the thread running environment will be persists. That is to say,
if you abort a thread and restart it the thread will run from the beginning
of the thread proc, so it is important to maintain the original state of
the resource in the thread to get the same behavior.
To troubleshoot the problem, I think you may need to write an log to the
file after every function call in your "dead" thread, so that you can
locate where code line cause the problem. You may have a few tests to see
if the problem persists in the same code line.
Here is an link about multiple thread programming you may take a look.
Threading Tutorial
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/
vcwlkThreadingTutorial.asp
Based on my experience, the synchronized object is used to control the
multiple threads access one or more resource. e.g. you have an global
variable, if one thread will write it and another one will read it, this
will cause problem when the two threads do the read or write operation in
the mean time.
(Another information maybe i should have told you this at an earlier point.
The services can run stable more than a month before this kind "dieing"
thread fenomenal occurs. Sometimes more somtimes less and sometimes it
doesent occur at all.)
If there exists multiple threads accessing one resource and you did not use
the synchronized mechanism to synchronize the threads, the behavior is very
strange.
If this is a big project, I think you may need to call Microsoft Product
Support Services (PSS) for further help.
If you have any concern on this issue, please post here.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.