??Windows????????С??????????????
???????????? ???????[ 2012/10/9 10:52:17 ] ????????
????CreateProcess???????????????????ID????????????????????????????ζ????????????????????????ID?????????0?????windows???????????????ID 0???????н?????????y??????δ?????????cpu??????
????dwProcessId??dwThreadId?????洢?????????ID?????GetCurrentProcessId?????????????ID??GetCurrentThreadId??????????????е?????ID?????????GetProcessId??GetThreadId?????????????????????????ID?????GetProcessIDOfThread???????????????????????????ID??
????????ID????????????á?????????????????????ID?????????????????п????????????????????????ID????????????????????????????????????????????????????????
???????????
?????????????????????????
????1???????????????????
????2???????е??????????ExitProcess??
????3????????????е???????TerminateProcess??
?????????????????????н??е???????????????????????????????????????????????????
?????????????????
????1????????????????????????κ?C++???????????????
????2?????????????????????檔
????3???????????????????????????????
????4??????????????ü??????1??
????????????????????????????????????????????????????????????C???????????????????????????????ExitProcess?????????????????????????????????????????????????????????????????
??????????????????ExitProcess?????????????????????????????С?
??????ExitProcess??????????ExitThread?????????????????????????????????????????????????????????г????????????????п???????????????????????е???WaitForSingleObject?????????????????????????????????????????????????????????????????????????
????????ExitProcess????ExitThread????????????????????У?????????????????????????????C++???????????????????С????????????????????y????????????????????????????????????????????Щ???????????????C++???????????????????????????????£??????????????ExitThread???????????????????????????????????????????????????????
?????????′???
#include<windows.h>
#include<iostream>
DWORD ThreadProc(PVOID)
{
int i=0;
int j=0;
while(i<1000000)
{
i++;
while(j<10000)
j++;
std::cout<<i<<"??"<<j<<std::endl;
}
return 0;
}
int main(int argc??char**argv)
{
DWORD id;
CreateThread(NULL??0??(LPTHREAD_START_ROUTINE)ThreadProc??NULL??0??&id);
ExitThread(0);
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11