Home > Software engineering >  Does not return to _beginthreadex function gets stuck, what reason be
Does not return to _beginthreadex function gets stuck, what reason be

Time:10-08

Himself wrote a Windows system under the use of pipes for interprocess communication procedures, including step is through
HANDLE hBusConn=(HANDLE) _beginthreadex (NULL, 0, m_BusConnThread, this, 0, NULL);
To implement different process pipe connection between operations,
But when the test found that sometimes this function will not return, thread function m_BusConnThread nor is up and running,
Static is the content of the m_BusConnThread unsigned int __stdcall m_BusConnThread (void * pPM) {return (pPM) (CBusPort *) - & gt; M_BusConn (); }
It is a class member function of another function called implementation of specific functions,
When I was in the loop test, the program function is normal, but ran ran could HANDLE hBusConn=(HANDLE) _beginthreadex (NULL, 0, m_BusConnThread, this, 0, NULL); It does not return,
I checked on the MSDN also did not mention any information on this function will be stuck,
Everyone who has also encountered similar problems, can help analyze the reason,

CodePudding user response:

Code stick up to look at it, the content of not less than ten words

CodePudding user response:

Should be related to piping, the code is not enough, not enough to analysis

CodePudding user response:

Multi-threading does not block, you see if you what inside thread

CodePudding user response:

Test and operation, and then point interruption, see if parked in where

CodePudding user response:

Thread interlock,

CodePudding user response:

"Windows core programming"
  • Related