Click to See Complete Forum and Search --> : Refreshing a Thread


Ravi Sangisetti
June 3rd, 1999, 12:12 AM
I am using multitheading in VC++ 5.0. I created a thread.




ThreadFunction()
{

DTL_READ(int x, 1000);
...
...
}




The DTL_READ function is supplied by some other vendor. Due to some problem, it is getting hanged at that function. I want to refresh the Thread. I will be able to know when the thread got hanged using another thread.

Can U suggest me the safest method of restarting the thread.
I strucked up in a major problem. Pls help me at the earliest.



Ravi Sangisetti
Sr.Software Engineer
Contech India Ltd
Gandinagar, India

ChrisD
June 3rd, 1999, 03:20 PM
The only thing you can do here is call TerminateThread. (It is listed as a dangerous thing to do). Your other option is to use a second exe and communicate via COM or RegisteredMessages and if it hangs you can terminate the other process and restart. This give the benifit of not doing strange things with your process space.

HTH,
Chris