CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    22

    Refreshing a Thread

    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

  2. #2
    Join Date
    May 1999
    Posts
    667

    Re: Refreshing a Thread

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured