What is the maximum process Id on Windows?

跟風遠走 提交于 2019-11-30 07:55:19

问题


What is the maximum process id I can get by calling DWORD GetProcessId(HANDLE) or DWORD GetCurrentProcessId()? It is not documented on the API's documentation page.


回答1:


According to the Pushing the Limits of Windows: Processes and Threads blog post by Mark Russinovich number of processes is limited only by available memory. So theoretically maximum process id is near DWORD_MAX (pids are divisible on 4).




回答2:


I couldn't find an official statement on it but since it's stored and returned as a DWORD you should assume it can use the entire 32-bit range. In practical systems I've never seen a PID large than ~200,000 though - since Windows will reuse PIDs they rarely get larger.



来源:https://stackoverflow.com/questions/17868218/what-is-the-maximum-process-id-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!