{"id":124455,"date":"2018-11-04T08:48:12","date_gmt":"2018-11-04T00:48:12","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=124455"},"modified":"2018-10-25T17:22:47","modified_gmt":"2018-10-25T09:22:47","slug":"interpreting-linux-processes","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/interpreting-linux-processes.html","title":{"rendered":"\u89e3\u8bfbLinux\u8fdb\u7a0b"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8ba1\u7b97\u673a\u5b9e\u9645\u4e0a\u53ef\u4ee5\u505a\u7684\u4e8b\u60c5\u5b9e\u8d28\u4e0a\u975e\u5e38\u7b80\u5355\uff0c\u6bd4\u5982\u8ba1\u7b97\u4e24\u4e2a\u6570\u7684\u548c\uff0c\u518d\u6bd4\u5982\u5728\u5185\u5b58\u4e2d\u5bfb\u627e\u5230\u67d0\u4e2a\u5730\u5740\u7b49\u7b49\u3002\u8fd9\u4e9b\u6700\u57fa\u7840\u7684\u8ba1\u7b97\u673a\u52a8\u4f5c\u88ab\u79f0\u4e3a\u6307\u4ee4(instruction)\u3002\u6240\u8c13\u7684\u7a0b\u5e8f(program)\uff0c\u5c31\u662f\u8fd9\u6837\u4e00\u7cfb\u5217\u6307\u4ee4\u7684\u6240\u6784\u6210\u7684\u96c6\u5408\u3002\u901a\u8fc7\u7a0b\u5e8f\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba9\u8ba1\u7b97\u673a\u5b8c\u6210\u590d\u6742\u7684\u64cd\u4f5c\u3002\u7a0b\u5e8f\u5927\u591a\u6570\u65f6\u5019\u88ab\u5b58\u50a8\u4e3a\u53ef\u6267\u884c\u7684\u6587\u4ef6\u3002\u8fd9\u6837\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u50cf\u662f\u4e00\u4e2a\u83dc\u8c31\uff0c\u8ba1\u7b97\u673a\u53ef\u4ee5\u6309\u7167\u83dc\u8c31\u4f5c\u51fa\u53ef\u53e3\u7684\u996d\u83dc\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u7a0b\u5e8f\u548c\u8fdb\u7a0b(process)\u7684\u533a\u522b\u662f\u4ec0\u4e48\u5462?<\/p>\n

\u8fdb\u7a0b\u662f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5177\u4f53\u5b9e\u73b0\u3002\u53ea\u6709\u98df\u8c31\u6ca1\u4ec0\u4e48\u7528\uff0c\u6211\u4eec\u603b\u8981\u6309\u7167\u98df\u8c31\u7684\u6307\u70b9\u771f\u6b63\u4e00\u6b65\u6b65\u5b9e\u884c\uff0c\u624d\u80fd\u505a\u51fa\u83dc\u80b4\u3002\u8fdb\u7a0b\u662f\u6267\u884c\u7a0b\u5e8f\u7684\u8fc7\u7a0b\uff0c\u7c7b\u4f3c\u4e8e\u6309\u7167\u98df\u8c31\uff0c\u771f\u6b63\u53bb\u505a\u83dc\u7684\u8fc7\u7a0b\u3002\u540c\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u6267\u884c\u591a\u6b21\uff0c\u6bcf\u6b21\u90fd\u53ef\u4ee5\u5728\u5185\u5b58\u4e2d\u5f00\u8f9f\u72ec\u7acb\u7684\u7a7a\u95f4\u6765\u88c5\u8f7d\uff0c\u4ece\u800c\u4ea7\u751f\u591a\u4e2a\u8fdb\u7a0b\u3002\u4e0d\u540c\u7684\u8fdb\u7a0b\u8fd8\u53ef\u4ee5\u62e5\u6709\u5404\u81ea\u72ec\u7acb\u7684IO\u63a5\u53e3\u3002<\/p>\n

\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e00\u4e2a\u91cd\u8981\u529f\u80fd\u5c31\u662f\u4e3a\u8fdb\u7a0b\u63d0\u4f9b\u65b9\u4fbf\uff0c\u6bd4\u5982\u8bf4\u4e3a\u8fdb\u7a0b\u5206\u914d\u5185\u5b58\u7a7a\u95f4\uff0c\u7ba1\u7406\u8fdb\u7a0b\u7684\u76f8\u5173\u4fe1\u606f\u7b49\u7b49\uff0c\u5c31\u597d\u50cf\u662f\u4e3a\u6211\u4eec\u51c6\u5907\u597d\u4e86\u4e00\u4e2a\u7cbe\u7f8e\u7684\u53a8\u623f\u3002<\/p>\n

\u8fdb\u7a0b<\/strong><\/div>\n

\u9996\u5148\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528$ps\u547d\u4ee4\u6765\u67e5\u8be2\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u6bd4\u5982$ps -eo pid,comm,cmd\uff0c\u4e0b\u56fe\u4e3a\u6267\u884c\u7ed3\u679c:<\/p>\n

(-e\u8868\u793a\u5217\u51fa\u5168\u90e8\u8fdb\u7a0b\uff0c-o pid,comm,cmd\u8868\u793a\u6211\u4eec\u9700\u8981PID\uff0cCOMMAND\uff0cCMD\u4fe1\u606f)<\/p>\n

\"\"<\/p>\n

\u6bcf\u4e00\u884c\u4ee3\u8868\u4e86\u4e00\u4e2a\u8fdb\u7a0b\u3002\u6bcf\u4e00\u884c\u53c8\u5206\u4e3a\u4e09\u5217\u3002\u7b2c\u4e00\u5217PID(process IDentity)\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u6bcf\u4e00\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2a\u552f\u4e00\u7684PID\u6765\u4ee3\u8868\u81ea\u5df1\u7684\u8eab\u4efd\uff0c\u8fdb\u7a0b\u4e5f\u53ef\u4ee5\u6839\u636ePID\u6765\u8bc6\u522b\u5176\u4ed6\u7684\u8fdb\u7a0b\u3002\u7b2c\u4e8c\u5217COMMAND\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u7684\u7b80\u79f0\u3002\u7b2c\u4e09\u5217CMD\u662f\u8fdb\u7a0b\u6240\u5bf9\u5e94\u7684\u7a0b\u5e8f\u4ee5\u53ca\u8fd0\u884c\u65f6\u6240\u5e26\u7684\u53c2\u6570\u3002<\/p>\n

(\u7b2c\u4e09\u5217\u6709\u4e00\u4e9b\u7531\u4e2d\u62ec\u53f7[]\u62ec\u8d77\u6765\u7684\u3002\u5b83\u4eec\u662f\u5185\u6838\u7684\u4e00\u90e8\u5206\u529f\u80fd\uff0c\u88ab\u6253\u626e\u6210\u8fdb\u7a0b\u7684\u6837\u5b50\u4ee5\u65b9\u4fbf\u64cd\u4f5c\u7cfb\u7edf\u7ba1\u7406\u3002\u6211\u4eec\u4e0d\u5fc5\u8003\u8651\u5b83\u4eec\u3002)<\/p>\n

\u6211\u4eec\u770b\u7b2c\u4e00\u884c\uff0cPID\u4e3a1\uff0c\u540d\u5b57\u4e3ainit\u3002\u8fd9\u4e2a\u8fdb\u7a0b\u662f\u6267\u884c\/bin\/init\u8fd9\u4e00\u6587\u4ef6(\u7a0b\u5e8f)\u751f\u6210\u7684\u3002\u5f53Linux\u542f\u52a8\u7684\u65f6\u5019\uff0cinit\u662f\u7cfb\u7edf\u521b\u5efa\u7684\u7b2c\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u8fd9\u4e00\u8fdb\u7a0b\u4f1a\u4e00\u76f4\u5b58\u5728\uff0c\u76f4\u5230\u6211\u4eec\u5173\u95ed\u8ba1\u7b97\u673a\u3002\u8fd9\u4e00\u8fdb\u7a0b\u6709\u7279\u6b8a\u7684\u91cd\u8981\u6027\uff0c\u6211\u4eec\u4f1a\u4e0d\u65ad\u63d0\u5230\u5b83\u3002<\/p>\n

\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u8fdb\u7a0b<\/strong><\/div>\n

\u5b9e\u9645\u4e0a\uff0c\u5f53\u8ba1\u7b97\u673a\u5f00\u673a\u7684\u65f6\u5019\uff0c\u5185\u6838(kernel)\u53ea\u5efa\u7acb\u4e86\u4e00\u4e2ainit\u8fdb\u7a0b\u3002Linux\u5185\u6838\u5e76\u4e0d\u63d0\u4f9b\u76f4\u63a5\u5efa\u7acb\u65b0\u8fdb\u7a0b\u7684\u7cfb\u7edf\u8c03\u7528\u3002\u5269\u4e0b\u7684\u6240\u6709\u8fdb\u7a0b\u90fd\u662finit\u8fdb\u7a0b\u901a\u8fc7fork\u673a\u5236\u5efa\u7acb\u7684\u3002\u65b0\u7684\u8fdb\u7a0b\u8981\u901a\u8fc7\u8001\u7684\u8fdb\u7a0b\u590d\u5236\u81ea\u8eab\u5f97\u5230\uff0c\u8fd9\u5c31\u662ffork\u3002fork\u662f\u4e00\u4e2a\u7cfb\u7edf\u8c03\u7528\u3002\u8fdb\u7a0b\u5b58\u6d3b\u4e8e\u5185\u5b58\u4e2d\u3002\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u5728\u5185\u5b58\u4e2d\u5206\u914d\u6709\u5c5e\u4e8e\u81ea\u5df1\u7684\u4e00\u7247\u7a7a\u95f4 (address space)\u3002\u5f53\u8fdb\u7a0bfork\u7684\u65f6\u5019\uff0cLinux\u5728\u5185\u5b58\u4e2d\u5f00\u8f9f\u51fa\u4e00\u7247\u65b0\u7684\u5185\u5b58\u7a7a\u95f4\u7ed9\u65b0\u7684\u8fdb\u7a0b\uff0c\u5e76\u5c06\u8001\u7684\u8fdb\u7a0b\u7a7a\u95f4\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230\u65b0\u7684\u7a7a\u95f4\u4e2d\uff0c\u6b64\u540e\u4e24\u4e2a\u8fdb\u7a0b\u540c\u65f6\u8fd0\u884c\u3002<\/p>\n

\u8001\u8fdb\u7a0b\u6210\u4e3a\u65b0\u8fdb\u7a0b\u7684\u7236\u8fdb\u7a0b(parent process)\uff0c\u800c\u76f8\u5e94\u7684\uff0c\u65b0\u8fdb\u7a0b\u5c31\u662f\u8001\u7684\u8fdb\u7a0b\u7684\u5b50\u8fdb\u7a0b(child process)\u3002\u4e00\u4e2a\u8fdb\u7a0b\u9664\u4e86\u6709\u4e00\u4e2aPID\u4e4b\u5916\uff0c\u8fd8\u4f1a\u6709\u4e00\u4e2aPPID(parent PID)\u6765\u5b58\u50a8\u7684\u7236\u8fdb\u7a0bPID\u3002\u5982\u679c\u6211\u4eec\u5faa\u7740PPID\u4e0d\u65ad\u5411\u4e0a\u8ffd\u6eaf\u7684\u8bdd\uff0c\u603b\u4f1a\u53d1\u73b0\u5176\u6e90\u5934\u662finit\u8fdb\u7a0b\u3002\u6240\u4ee5\u8bf4\uff0c\u6240\u6709\u7684\u8fdb\u7a0b\u4e5f\u6784\u6210\u4e00\u4e2a\u4ee5init\u4e3a\u6839\u7684\u6811\u72b6\u7ed3\u6784\u3002<\/p>\n

\u5982\u4e0b\uff0c\u6211\u4eec\u67e5\u8be2\u5f53\u524dshell\u4e0b\u7684\u8fdb\u7a0b\uff1a<\/p>\n

\n
 class=\"\">root@vamei:~<\/span># ps -o pid,ppid,cmd<\/span>\r\n\u00a0PID \u00a0PPID CMD\r\n16935<\/span>\u00a0\u00a03101<\/span>\u00a0sudo -i\r\n16939<\/span>\u00a016935<\/span>\u00a0-bash\r\n23774<\/span>\u00a016939<\/span>\u00a0ps -o pid,ppid,cmd<\/pre>\n<\/section>\n

\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u7b2c\u4e8c\u4e2a\u8fdb\u7a0bbash\u662f\u7b2c\u4e00\u4e2a\u8fdb\u7a0bsudo\u7684\u5b50\u8fdb\u7a0b\uff0c\u800c\u7b2c\u4e09\u4e2a\u8fdb\u7a0bps\u662f\u7b2c\u4e8c\u4e2a\u8fdb\u7a0b\u7684\u5b50\u8fdb\u7a0b\u3002<\/p>\n

\u8fd8\u53ef\u4ee5\u7528$pstree\u547d\u4ee4\u6765\u663e\u793a\u6574\u4e2a\u8fdb\u7a0b\u6811\uff1a<\/p>\n

\n
 class=\"\">init\u2500\u252c\u2500NetworkManager\u2500\u252c\u2500dhclient\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u2514\u25002*[{NetworkManager}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500accounts-daemon\u2500\u2500\u2500{accounts-daemon}\r\n\u00a0 \u00a0 \u251c\u2500acpid\r\n\u00a0 \u00a0 \u251c\u2500apache2\u2500\u252c\u2500apache2\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u2514\u25002*[apache2\u2500\u2500\u250026*[{apache2}]<\/span>]\r\n\u00a0 \u00a0 \u251c\u2500at-spi-bus-laun\u2500\u2500\u25002*[{at-spi-bus-laun}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500atd\r\n\u00a0 \u00a0 \u251c\u2500avahi-daemon\u2500\u2500\u2500avahi-daemon\r\n\u00a0 \u00a0 \u251c\u2500bluetoothd\r\n\u00a0 \u00a0 \u251c\u2500colord\u2500\u2500\u25002*[{colord}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500console-kit-dae\u2500\u2500\u250064*[{console-kit-dae}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500cron\r\n\u00a0 \u00a0 \u251c\u2500cupsd\u2500\u2500\u25002*[dbus]<\/span>\r\n\u00a0 \u00a0 \u251c\u25002*[dbus-daemon]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500dbus-launch\r\n\u00a0 \u00a0 \u251c\u2500dconf-service\u2500\u2500\u25002*[{dconf-service}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500dropbox\u2500\u2500\u250015*[{dropbox}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500firefox\u2500\u2500\u250027*[{firefox}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500gconfd-2\r\n\u00a0 \u00a0 \u251c\u2500geoclue-master\r\n\u00a0 \u00a0 \u251c\u25006*[getty]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500gnome-keyring-d\u2500\u2500\u25007*[{gnome-keyring-d}]<\/span>\r\n\u00a0 \u00a0 \u251c\u2500gnome-terminal\u2500\u252c\u2500bash\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u251c\u2500bash\u2500\u2500\u2500pstree\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u251c\u2500gnome-pty-helpe\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u251c\u2500sh\u2500\u2500\u2500R\u2500\u2500\u2500{R}\r\n\u00a0 \u00a0 \u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u2514\u25003*[{gnome-terminal}]<\/span><\/pre>\n<\/section>\n

fork\u901a\u5e38\u4f5c\u4e3a\u4e00\u4e2a\u51fd\u6570\u88ab\u8c03\u7528\u3002\u8fd9\u4e2a\u51fd\u6570\u4f1a\u6709\u4e24\u6b21\u8fd4\u56de\uff0c\u5c06\u5b50\u8fdb\u7a0b\u7684PID\u8fd4\u56de\u7ed9\u7236\u8fdb\u7a0b\uff0c0\u8fd4\u56de\u7ed9\u5b50\u8fdb\u7a0b\u3002\u5b9e\u9645\u4e0a\uff0c\u5b50\u8fdb\u7a0b\u603b\u53ef\u4ee5\u67e5\u8be2\u81ea\u5df1\u7684PPID\u6765\u77e5\u9053\u81ea\u5df1\u7684\u7236\u8fdb\u7a0b\u662f\u8c01\uff0c\u8fd9\u6837\uff0c\u4e00\u5bf9\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u5c31\u53ef\u4ee5\u968f\u65f6\u67e5\u8be2\u5bf9\u65b9\u3002<\/p>\n

\u901a\u5e38\u5728\u8c03\u7528fork\u51fd\u6570\u4e4b\u540e\uff0c\u7a0b\u5e8f\u4f1a\u8bbe\u8ba1\u4e00\u4e2aif\u9009\u62e9\u7ed3\u6784\u3002\u5f53PID\u7b49\u4e8e0\u65f6\uff0c\u8bf4\u660e\u8be5\u8fdb\u7a0b\u4e3a\u5b50\u8fdb\u7a0b\uff0c\u90a3\u4e48\u8ba9\u5b83\u6267\u884c\u67d0\u4e9b\u6307\u4ee4,\u6bd4\u5982\u8bf4\u4f7f\u7528exec\u5e93\u51fd\u6570(library function)\u8bfb\u53d6\u53e6\u4e00\u4e2a\u7a0b\u5e8f\u6587\u4ef6\uff0c\u5e76\u5728\u5f53\u524d\u7684\u8fdb\u7a0b\u7a7a\u95f4\u6267\u884c (\u8fd9\u5b9e\u9645\u4e0a\u662f\u6211\u4eec\u4f7f\u7528fork\u7684\u4e00\u5927\u76ee\u7684: \u4e3a\u67d0\u4e00\u7a0b\u5e8f\u521b\u5efa\u8fdb\u7a0b)\uff1b\u800c\u5f53PID\u4e3a\u4e00\u4e2a\u6b63\u6574\u6570\u65f6\uff0c\u8bf4\u660e\u4e3a\u7236\u8fdb\u7a0b\uff0c\u5219\u6267\u884c\u53e6\u5916\u4e00\u4e9b\u6307\u4ee4\u3002\u7531\u6b64\uff0c\u5c31\u53ef\u4ee5\u5728\u5b50\u8fdb\u7a0b\u5efa\u7acb\u4e4b\u540e\uff0c\u8ba9\u5b83\u6267\u884c\u4e0e\u7236\u8fdb\u7a0b\u4e0d\u540c\u7684\u529f\u80fd\u3002<\/p>\n

\u5b50\u8fdb\u7a0b\u7684\u7ec8\u7ed3(termination)<\/strong><\/div>\n

\u5f53\u5b50\u8fdb\u7a0b\u7ec8\u7ed3\u65f6\uff0c\u5b83\u4f1a\u901a\u77e5\u7236\u8fdb\u7a0b\uff0c\u5e76\u6e05\u7a7a\u81ea\u5df1\u6240\u5360\u636e\u7684\u5185\u5b58\uff0c\u5e76\u5728\u5185\u6838\u91cc\u7559\u4e0b\u81ea\u5df1\u7684\u9000\u51fa\u4fe1\u606f(exit code\uff0c\u5982\u679c\u987a\u5229\u8fd0\u884c\uff0c\u4e3a0\uff1b\u5982\u679c\u6709\u9519\u8bef\u6216\u5f02\u5e38\u72b6\u51b5\uff0c\u4e3a>0\u7684\u6574\u6570)\u3002\u5728\u8fd9\u4e2a\u4fe1\u606f\u91cc\uff0c\u4f1a\u89e3\u91ca\u8be5\u8fdb\u7a0b\u4e3a\u4ec0\u4e48\u9000\u51fa\u3002\u7236\u8fdb\u7a0b\u5728\u5f97\u77e5\u5b50\u8fdb\u7a0b\u7ec8\u7ed3\u65f6\uff0c\u6709\u8d23\u4efb\u5bf9\u8be5\u5b50\u8fdb\u7a0b\u4f7f\u7528wait\u7cfb\u7edf\u8c03\u7528\u3002\u8fd9\u4e2await\u51fd\u6570\u80fd\u4ece\u5185\u6838\u4e2d\u53d6\u51fa\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u4fe1\u606f\uff0c\u5e76\u6e05\u7a7a\u8be5\u4fe1\u606f\u5728\u5185\u6838\u4e2d\u6240\u5360\u636e\u7684\u7a7a\u95f4\u3002\u4f46\u662f\uff0c\u5982\u679c\u7236\u8fdb\u7a0b\u65e9\u4e8e\u5b50\u8fdb\u7a0b\u7ec8\u7ed3\uff0c\u5b50\u8fdb\u7a0b\u5c31\u4f1a\u6210\u4e3a\u4e00\u4e2a\u5b64\u513f(orphand)\u8fdb\u7a0b\u3002\u5b64\u513f\u8fdb\u7a0b\u4f1a\u88ab\u8fc7\u7ee7\u7ed9init\u8fdb\u7a0b\uff0cinit\u8fdb\u7a0b\u4e5f\u5c31\u6210\u4e86\u8be5\u8fdb\u7a0b\u7684\u7236\u8fdb\u7a0b\u3002init\u8fdb\u7a0b\u8d1f\u8d23\u8be5\u5b50\u8fdb\u7a0b\u7ec8\u7ed3\u65f6\u8c03\u7528wait\u51fd\u6570\u3002<\/p>\n

\u5f53\u7136\uff0c\u4e00\u4e2a\u7cdf\u7cd5\u7684\u7a0b\u5e8f\u4e5f\u5b8c\u5168\u53ef\u80fd\u9020\u6210\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u4fe1\u606f\u6ede\u7559\u5728\u5185\u6838\u4e2d\u7684\u72b6\u51b5\uff08\u7236\u8fdb\u7a0b\u4e0d\u5bf9\u5b50\u8fdb\u7a0b\u8c03\u7528wait\u51fd\u6570\uff09\uff0c\u8fd9\u6837\u7684\u60c5\u51b5\u4e0b\uff0c\u5b50\u8fdb\u7a0b\u6210\u4e3a\u50f5\u5c38\uff08zombie\uff09\u8fdb\u7a0b\u3002\u5f53\u5927\u91cf\u50f5\u5c38\u8fdb\u7a0b\u79ef\u7d2f\u65f6\uff0c\u5185\u5b58\u7a7a\u95f4\u4f1a\u88ab\u6324\u5360\u3002<\/p>\n

\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b(thread)<\/strong><\/div>\n

\u5c3d\u7ba1\u5728UNIX\u4e2d\uff0c\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\u662f\u6709\u8054\u7cfb\u4f46\u4e0d\u540c\u7684\u4e24\u4e2a\u4e1c\u897f\uff0c\u4f46\u5728Linux\u4e2d\uff0c\u7ebf\u7a0b\u53ea\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u8fdb\u7a0b\u3002\u591a\u4e2a\u7ebf\u7a0b\u4e4b\u95f4\u53ef\u4ee5\u5171\u4eab\u5185\u5b58\u7a7a\u95f4\u548cIO\u63a5\u53e3\u3002\u6240\u4ee5\uff0c\u8fdb\u7a0b\u662fLinux\u7a0b\u5e8f\u7684\u552f\u4e00\u7684\u5b9e\u73b0\u65b9\u5f0f\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u7a0b\u5e8f\uff0c\u8fdb\u7a0b\uff0cPID\uff0c\u5185\u5b58\u7a7a\u95f4<\/p>\n

\u5b50\u8fdb\u7a0b\uff0c\u7236\u8fdb\u7a0b\uff0cPPID\uff0cfork\uff0c wait<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u8ba1\u7b97\u673a\u5b9e\u9645\u4e0a\u53ef\u4ee5\u505a\u7684\u4e8b\u60c5\u5b9e\u8d28\u4e0a\u975e\u5e38\u7b80\u5355\uff0c\u6bd4\u5982\u8ba1\u7b97\u4e24\u4e2a\u6570\u7684\u548c\uff0c\u518d\u6bd4\u5982\u5728\u5185\u5b58\u4e2d\u5bfb\u627e\u5230\u67d0\u4e2a\u5730\u5740\u7b49\u7b49\u3002\u8fd9\u4e9b\u6700\u57fa\u7840 […]<\/p>\n","protected":false},"author":63,"featured_media":124457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-124455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/124455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=124455"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/124455\/revisions"}],"predecessor-version":[{"id":126847,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/124455\/revisions\/126847"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/124457"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=124455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=124455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=124455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}