Question Need to Find out

? Differences between CreateThread and _beginthread

! There are four methods to terminate sub thread

  • return from the end of the function
  • ExitThread itself
  • TerminateThread by other thread
  • Terminate the owed process

? windows code should be using ExitThread; c/c++ code should be used _endthread to terminate the thread. So definition of windows code and c++/c code?

! ExitThread以及函数返回能够释放分配给线程的堆栈空间,然后使用TerminateThread将不会通知被关闭线程(同时他也是异步的),如果使用了这个方法,就只能等待拥有这个线程的进程关闭来释放。这个原理是windows估值设计,同时也适用于DLL创建的线程。

你可能感兴趣的:(find)