process termination issue
-
hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap
-
hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap
-
What mechanism are you using to signal to the running threads that its time to stop?
If you think you can than you can, if you think you can't you are right.
Thanks for the reply. Here is the way I'm terminating. 1. PostThreadMessage(WM_QUIT, NULL, NULL); 2. dwState = ::WaitForSingleObject(m_hThread, 6000); 3. if(dwState != WAIT_OBJECT_0) TerminateThread(m_hThread, dwExitCode);
-- Pratap -
hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap
Stack traces of what the application is doing when hung would be a big help. Also, what framework (if any) is being used?
Steve