{"rsdb":{"rid":"156013","subhead":"","postdate":"0","aid":"117119","fid":"49","uid":"1","topic":"1","content":"
\n C\/C++<\/a>\u6559\u7a0b\u4e4b\u7236\u5b50\u8fdb\u7a0b\uff1a<\/strong>\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u662f\u670d\u52a1\u5668\n \u7f16\u7a0b<\/a><\/a>\u7684\u5e38\u5ba2\uff0c\u771f\u6b63\u7406\u89e3\u6e05\u695a\u5e76\u4e0d\u662f\u4e00\u4ef6\u5bb9\u6613\u7684\u4e8b\uff0cC\/C++<\/a>\u4f5c\u4e3a\u96be\u5b66\u6613\u7528\u7684\u4ee3\u8868\uff0c\u5728\u670d\u52a1\u5668\u7f16\u7a0b<\/a>\u4e0a\u8868\u73b0\u7684\u5c24\u4e3a\u660e\u663e\uff0c\u7528\u4e4b\u524d\u9700\u8981\u7406\u89e3\u8fd9\u4e2a\u4e1c\u897f\u7684\u4f53\u7cfb\u67b6\u6784\u662f\u600e\u6837\u7684\uff0c\u5426\u5219\u7a0d\u4e0d\u6ce8\u610f\u5c31\u662f\u4e00\u573a\u707e\u96be\uff0c\u7136\u540e\u672b\u65e5\u6765\u4e34\u3002 \n

\u4e00\u3001\u4ec0\u4e48\u662f\u8fdb\u7a0b<\/p> \n

\u76f4\u89c2\u4e00\u70b9\u53ef\u4ee5\u7406\u89e3\u4e3a\u4e00\u4e2a\u6267\u884c\u8d77\u6765\u7684\u7a0b\u5e8f<\/p> \n

\u6240\u6709\u8fdb\u7a0b\u5c5e\u6027\u91c7\u7528\u7ed3\u6784\u4f53\u7ef4\u62a4->\u6811\u72b6\u7ed3\u6784\u4f53<\/p> \n

ps \u67e5\u770b\u6240\u6709\u8fdb\u7a0b\u5e38\u89c1\u5c5e\u6027<\/p> \n

top \u67e5\u770b\u7cfb\u7edf<\/a>\u8fdb\u7a0b\u6267\u884c\u72b6\u51b5<\/p> \n

pstree \u6811\u5f62\u663e\u793a\u8fdb\u7a0b<\/p> \n

kill \u5411\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7<\/p> \n

kill -s \u4fe1\u53f7 \u8fdb\u7a0bid<\/p> \n

kill -l \u663e\u793a\u8fdb\u7a0b\u80fd\u63a5\u6536\u7684\u6240\u6709\u4fe1\u53f7<\/p> \n

\u4e8c\u3001\u521b\u5efa\u8fdb\u7a0b<\/p> \n

\u8fdb\u7a0b\u6709\u5173\u7684\u521b\u5efa\u51fd\u6570<\/p> \n

int system(const char* filename);<\/p> \n

\u5efa\u7acb\u72ec\u7acb\u8fdb\u7a0b\uff0c\u62e5\u6709\u72ec\u7acb\u7684\u4ee3\u7801\u7a7a\u95f4\uff0c\u72ec\u7acb\u7684\u5185\u5b58\u7a7a\u95f4<\/p> \n

\u7b49\u5f85\u65b0\u7684\u8fdb\u7a0b\u6267\u884c\u5b8c\u6bd5\uff0csystem\u624d\u8fd4\u56de<\/p> \n

popen<\/p> \n

exec\u7cfb\u5217\u51fd\u6570<\/p> \n

fork<\/p> \n

pid_t fork();<\/p> \n

\u521b\u5efa\u8fdb\u7a0b<\/p> \n

<\/p> \n

\u4e09\u3001\u7406\u89e3\u8fdb\u7a0b<\/p> \n

1.\u7236\u5b50\u8fdb\u7a0b\u7684\u5173\u7cfb<\/p> \n

\u72ec\u7acb\u7684\u4e24\u4e2a\u8fdb\u7a0b<\/p> \n

pstree\u4e0a\u9762\u4e92\u4e3a\u7236\u5b50\u5173\u7cfb\u7684\u4e24\u4e2a\u8fdb\u7a0b\u8282\u70b9<\/p> \n

2.\u95ee\u9898\uff1a<\/p> \n

\u7236\u8fdb\u7a0b\u5148\u7ed3\u675f\u5bfc\u81f4<\/p> \n

-> \u5b50\u8fdb\u7a0b\u5c31\u76f4\u63a5\u4f9d\u6258\u6839\u8fdb\u7a0binit\uff0c\u6210\u4e3a\u5b64\u513f\u8fdb\u7a0b\uff0c\u65e0\u4efb\u4f55\u5371\u5bb3<\/p> \n

\u5b50\u8fdb\u7a0b\u5148\u7ed3\u675f\u5bfc\u81f4<\/p> \n

-> \u5b50\u8fdb\u7a0b\u4f1a\u6210\u4e3a\u50f5\u5c38\u8fdb\u7a0b\uff0c\u4e0d\u5360\u7528\u5185\u5b58\uff0c\u4e0d\u5360\u7528CPU\uff0c\u4f46\u5728\u8fdb\u7a0b\u6811\u5360\u7528\u4e00\u4e2a\u8282\u70b9<\/p> \n

\u9020\u6210\u8fdb\u7a0b\u540d\u989d\u7684\u8d44\u6e90\u6d6a\u8d39\uff0c\u5fc5\u987b\u5904\u7406\u50f5\u5c38\u8fdb\u7a0b<\/p> \n

3.\u50f5\u5c38\u8fdb\u7a0b\u4f7f\u7528wait\u56de\u6536<\/p> \n

4.\u7236\u8fdb\u7a0b\u5982\u4f55\u77e5\u9053\u5b50\u8fdb\u7a0b\u9000\u51fa<\/p> \n

\u5b50\u8fdb\u7a0b\u7ed3\u675f\u901a\u5e38\u4f1a\u5411\u7236\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a\u4fe1\u53f7SIGCHLD\uff0817\uff09<\/p> \n

5.\u7236\u8fdb\u7a0b\u5904\u7406\u5b50\u8fdb\u7a0b\u9000\u51fa\u4fe1\u53f7<\/p> \n

signal(int sig,void (*fun) (int));<\/p> \n

\u5411\u7cfb\u7edf\u6ce8\u518c\uff1a\u53ea\u8981sig\u4fe1\u53f7\u53d1\u751f\uff0c\u7cfb\u7edf\u505c\u6b62\u8fdb\u7a0b\uff0c\u5e76\u8c03\u7528\u6ce8\u518c\u51fd\u6570fun<\/p> \n

\u5f53\u51fd\u6570\u6267\u884c\u5b8c\u6bd5\uff0c\u7ee7\u7eed\u539f\u6765\u8fdb\u7a0b<\/p> \n

6.\u7236\u5b50\u8fdb\u7a0b\u7684\u8d44\u6e90\u8bbf\u95ee<\/p> \n

6.1 \u5185\u5b58\u8d44\u6e90<\/p> \n

\u5b50\u8fdb\u7a0b\u514b\u9686\u6574\u4e2a\u5185\u5b58\u533a\u57df\uff0c\u4f46\u5185\u5b58\u533a\u57df\u6307\u5411\u4e0d\u540c\u7684\u7269\u7406\u7a7a\u95f4<\/p> \n

\u4f46\u5185\u5b58\u72ec\u7acb\uff0c\u4e0d\u80fd\u76f8\u4e92\u8bbf\u95ee<\/p> \n

6.2 \u6587\u4ef6\u8d44\u6e90<\/p> \n

\u4e24\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\uff0c\u6587\u4ef6\u63cf\u8ff0\u7b26\u6307\u5411\u7684\u662f\u540c\u4e00\u4e2a\u6587\u4ef6<\/p> \n

7. \u591a\u8fdb\u7a0b\u4e0e\u6587\u4ef6\u9501<\/p> \n

\u56db\u3001\u8fdb\u7a0b\u63a7\u5236\uff08\u540e\u7eed\u66f4\u65b0...\uff09<\/p> \n<\/dd>","orderid":"0","title":"C\/C++\u6559\u7a0b\u4e4b\u7236\u5b50\u8fdb\u7a0b","smalltitle":"","mid":"0","fname":"c++\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"124","pages":"1","comments":"0","posttime":"2017-01-10 08:14:56","list":"1484007296","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"C\/C<\/A> \u6559\u7a0b<\/A> \u7236\u5b50<\/A> \u8fdb\u7a0b<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"14.17.22.36","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"C\/C++\u6559\u7a0b\u4e4b\u7236\u5b50\u8fdb\u7a0b","lastview":"1493201011","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}