{"id":5776,"date":"2024-09-01T20:01:03","date_gmt":"2024-09-01T12:01:03","guid":{"rendered":""},"modified":"2024-09-01T20:01:03","modified_gmt":"2024-09-01T12:01:03","slug":"\u64cd\u4f5c\u7cfb\u7edf\u671f\u672b\u586b\u7a7a\u9898_\u89e3\u91ca\u4ee5\u4e0b\u672f\u8bed\u786c\u4ef6\u8f6f\u4ef6\u591a\u9053\u7a0b\u5e8f\u8bbe\u8ba1","status":"publish","type":"post","link":"https:\/\/mushiming.com\/5776.html","title":{"rendered":"\u64cd\u4f5c\u7cfb\u7edf\u671f\u672b\u586b\u7a7a\u9898_\u89e3\u91ca\u4ee5\u4e0b\u672f\u8bed\u786c\u4ef6\u8f6f\u4ef6\u591a\u9053\u7a0b\u5e8f\u8bbe\u8ba1"},"content":{"rendered":"
\uff08\u8bf4\u660e\uff1a\u4ec5\u9002\u7528\u4e8e\u5e2e\u52a9\u5927\u5bb6\u5c06\u77e5\u8bc6\u70b9\u68b3\u7406\u4e00\u904d\uff0c\u60f3\u8981\u901a\u8fc7\u8003\u8bd5\u8fd8\u662f\u8981\u7ed3\u5408\u9898\u76ee\u8fdb\u884c\u81ea\u4e3b\u590d\u4e60\uff0c\u67e5\u6f0f\u8865\u7f3a\u3002<\/strong><\/em><\/span><\/p>\n ###\u795d\u5927\u5bb6\u671f\u672b\u64cd\u4f5c\u7cfb\u7edf\u90fd\u80fd\u53d6\u5f97\u7406\u60f3\u7684\u6210\u7ee9\uff01\uff01\uff01\uff09<\/strong><\/em><\/span><\/p>\n<\/p>\n 1.1\u6982\u5ff5\uff1a\u6b7b\u9501\u662f\u6307\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a<\/strong><\/span><\/em>\u7684\u8fdb\u7a0b\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u7ade\u4e89\u8d44\u6e90\u6216\u8005\u7531\u4e8e\u5f7c\u6b64\u901a\u4fe1\u800c\u9020\u6210\u7684\u4e00\u79cd\u963b\u585e<\/strong>\u7684\u73b0\u8c61\uff0c\u82e5\u65e0\u5916\u529b\u4f5c\u7528\uff0c\u5b83\u4eec\u90fd\u5c06\u65e0\u6cd5\u63a8\u8fdb\u4e0b\u53bb\u3002\u6b64\u65f6\u79f0\u7cfb\u7edf\u5904\u4e8e\u6b7b\u9501\u72b6\u6001\u6216\u7cfb\u7edf\u4ea7\u751f\u4e86\u6b7b\u9501\uff0c\u8fd9\u4e9b\u6c38\u8fdc\u5728\u4e92\u76f8\u7b49\u5f85<\/strong>\u7684\u8fdb\u7a0b\u79f0\u4e3a\u6b7b\u9501\u8fdb\u7a0b\u3002<\/p>\n 1.2\u539f\u56e0\uff1a\uff081\uff09\u7cfb\u7edf\u63d0\u4f9b\u7684\u8d44\u6e90\u6709\u9650\uff1b\uff082\uff09\u8fdb\u7a0b\u63a8\u8fdb\u987a\u5e8f\u4e0d\u5f53\u3002<\/p>\n 1.3\u5fc5\u8981\u6761\u4ef6\uff1a \uff081\uff09\u4e92\u65a5\u6761\u4ef6\u3001\uff082\uff09\u4e0d\u53ef\u5265\u593a\u6761\u4ef6\u3001\uff083\uff09\u8bf7\u6c42\u548c\u4fdd\u6301\u6761\u4ef6\u3001\uff084\uff09\u5faa\u73af\u7b49\u5f85<\/span><\/strong>\u6761\u4ef6\u3002<\/p>\n \u25cf\u9884\u9632\u6b7b\u9501\uff08\u6700\u5bb9\u6613\u5b9e\u73b0):<\/u><\/p>\n (1)\u6452\u5f03\u201c\u8bf7\u6c42\u548c\u4fdd\u6301\u201d\u6761\u4ef6<\/p>\n (2)\u6452\u5f03\u201c\u4e0d\u5265\u593a\u201d\u6761\u4ef6<\/p>\n (3)\u6452\u5f03\u201c\u73af\u8def\u7b49\u5f85\u201d\u6761\u4ef6<\/p>\n \u25cf \u907f\u514d\u6b7b\u9501\uff08\u94f6\u884c\u5bb6\u7b97\u6cd5<\/strong>\uff09<\/u><\/p>\n \u25cf \u68c0\u6d4b\u548c\u89e3\u9664\u6b7b\u9501<\/u><\/p>\n<\/p>\n PS<\/strong>\uff1a\u8fdb\u7a0b\u548c\u7a0b\u5e8f\u6709\u4ec0\u4e48\u533a\u522b\u548c\u8054\u7cfb?<\/em><\/p>\n \uff081\uff09\u8fdb\u7a0b<\/strong>\u662f\u4e00\u4e2a\u52a8\u6001<\/strong><\/span>\u6982\u5ff5\uff0c\u800c\u7a0b\u5e8f<\/strong>\u662f\u4e00\u4e2a\u9759\u6001<\/strong><\/span>\u6982\u5ff5\uff0c\u7a0b\u5e8f<\/strong>\u662f\u6307\u4ee4\u7684\u6709\u5e8f<\/span>\u96c6\u5408<\/strong>\uff0c\u65e0\u6267\u884c\u542b\u4e49\uff0c\u8fdb\u7a0b<\/strong>\u5219\u5f3a\u8c03\u6267\u884c<\/strong>\u7684\u8fc7\u7a0b\u3002<\/em><\/p>\n \uff082\uff09\u8fdb\u7a0b<\/strong>\u5177\u6709\u5e76\u884c<\/strong><\/span>\u7279\u5f81\uff0c\u7a0b\u5e8f\u6ca1\u6709<\/strong>\u3002<\/em><\/p>\n \uff083\uff09\u8fdb\u7a0b<\/strong>\u662f\u7ade\u4e89\u8ba1\u7b97\u673a\u7cfb\u7edf\u8d44\u6e90\u7684\u57fa\u672c\u5355\u4f4d<\/strong>\u3002<\/em><\/p>\n \uff084\uff09\u4e0d\u540c\u7684\u8fdb\u7a0b\u53ef\u4ee5\u5305\u542b\u540c\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u540c\u4e00\u7a0b\u5e8f\u4e5f\u53ef\u4ea7\u751f\u591a\u4e2a\u8fdb\u7a0b<\/u>\u3002<\/em><\/p>\n<\/p>\n \u7531\u4e8e\u591a\u4e2a\u8fdb\u7a0b\u5728\u5e76\u53d1\u6267\u884c\u65f6\u5171\u4eab\u7cfb\u7edf\u8d44\u6e90\uff0c\u81f4\u4f7f\u5b83\u4eec\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5448\u73b0\u95f4\u65ad\u6027\u7684\u8fd0\u884c\u89c4\u5f8b\uff0c\u6240\u4ee5\u8fdb\u7a0b\u5728\u751f\u547d\u5468\u671f\u5185\u53ef\u80fd\u5177\u6709\u591a\u79cd\u72b6\u6001\u3002\u4e00\u822c\u800c\u8a00\uff0c\u6bcf\u4e00\u4e2a\u8fdb\u7a0b\u81f3\u5c11\u5e94\u5904\u4e8e\u4ee5\u4e0b\u4e09\u79cd\u72b6\u6001\u4e4b\u4e00\uff1a<\/p>\n \uff081\uff09\u5c31\u7eea<\/strong>\u72b6\u6001\uff1a\u8fdb\u7a0b\u5df2\u83b7\u5f97\u9664CPU\u5916\u7684\u6240\u6709\u5fc5\u8981\u8d44\u6e90\uff0c\u53ea\u7b49\u5f85CPU<\/strong>\u65f6\u7684\u72b6\u6001\u3002\u4e00\u4e2a\u7cfb\u7edf\u4f1a\u5c06\u591a\u4e2a\u5904\u4e8e\u5c31\u7eea\u72b6\u6001\u7684\u8fdb\u7a0b\u6392\u6210\u4e00\u4e2a\u5c31\u7eea\u961f\u5217\u3002<\/p>\n \uff082\uff09\u6267\u884c<\/strong>\u72b6\u6001\uff1a\u8fdb\u7a0b\u5df2\u83b7CPU\uff0c\u6b63\u5728\u6267\u884c<\/strong>\u3002\u5355\u5904\u7406\u673a\u7cfb\u7edf\u4e2d\uff0c\u5904\u4e8e\u6267\u884c\u72b6\u6001\u7684\u8fdb\u7a0b\u53ea\u4e00\u4e2a\uff1b\u591a\u5904\u7406\u673a\u7cfb\u7edf\u4e2d\uff0c\u6709\u591a\u4e2a\u5904\u4e8e\u6267\u884c\u72b6\u6001\u7684\u8fdb\u7a0b\u3002<\/p>\n \uff083\uff09\u963b\u585e<\/strong>\u72b6\u6001\uff1a\u6b63\u5728\u6267\u884c\u7684\u8fdb\u7a0b\u7531\u4e8e\u67d0\u79cd\u539f\u56e0\u800c\u6682\u65f6\u65e0\u6cd5\u7ee7\u7eed\u6267\u884c<\/strong>\uff0c\u4fbf\u653e\u5f03\u5904\u7406\u673a\u800c\u5904\u4e8e\u6682\u505c\u72b6\u6001<\/strong>\uff0c\u5373\u8fdb\u7a0b\u6267\u884c\u53d7\u963b<\/strong>\u3002\uff08\u8fd9\u79cd\u72b6\u6001\u53c8\u79f0\u7b49\u5f85\u72b6\u6001<\/strong>\u6216\u5c01\u9501\u72b6\u6001<\/strong>\uff09<\/p>\n <\/p>\n <\/p>\n<\/p>\n \uff081\uff09 \u521b\u5efa\u72b6\u6001<\/strong>\uff1a\u8fdb\u7a0b\u5728\u521b\u5efa\u65f6\u9700\u8981\u7533\u8bf7\u4e00\u4e2a\u7a7a\u767dPCB\uff0c\u5411\u5176\u4e2d\u586b\u5199\u63a7\u5236\u548c\u7ba1\u7406\u8fdb\u7a0b\u7684\u4fe1\u606f\uff0c\u5b8c\u6210\u8d44\u6e90\u5206\u914d\u3002\u5982\u679c\u521b\u5efa\u5de5\u4f5c\u65e0\u6cd5\u5b8c\u6210\uff0c\u6bd4\u5982\u8d44\u6e90\u65e0\u6cd5\u6ee1\u8db3\uff0c\u5c31\u65e0\u6cd5\u88ab\u8c03\u5ea6\u8fd0\u884c\uff0c\u628a\u6b64\u65f6\u8fdb\u7a0b\u6240\u5904\u72b6\u6001\u79f0\u4e3a\u521b\u5efa\u72b6\u6001\u3002<\/p>\n \uff082\uff09 \u7ec8\u6b62\u72b6\u6001<\/strong>\uff1a\u8fdb\u7a0b\u7ed3\u675f\uff0c\u6216\u51fa\u73b0\u9519\u8bef\uff0c\u6216\u88ab\u7cfb\u7edf\u7ec8\u6b62\uff0c\u8fdb\u5165\u7ec8\u6b62\u72b6\u6001\u3002\u65e0\u6cd5\u518d\u6267\u884c\u3002<\/p>\n <\/p>\n \uff08 PS\uff1a<\/em><\/strong>\u5982\u679c\u8fdb\u7a0b\u8fd0\u884c\u65f6\u95f4\u7247\u4f7f\u7528\u5b8c<\/strong>\u4e5f\u4f1a\u8fdb\u5165\u5c31\u7eea\u72b6\u6001\uff09<\/strong><\/em><\/p>\n<\/p>\n \u4e3a\u7528\u6237\u89c2\u5bdf\u9700\u8981\uff0c\u8fdb\u7a0b\u8fd8\u6709\u6302\u8d77<\/strong>\u548c\u6fc0\u6d3b<\/strong>\u4e24\u79cd\u64cd\u4f5c\u3002\u6302\u8d77\u540e<\/strong>\u8fdb\u7a0b\u5904\u4e8e\u9759\u6b62\u72b6\u6001<\/strong>\u8fdb\u7a0b\u4e0d\u518d\u88ab\u7cfb\u7edf\u8c03\u7528<\/strong>\uff0c\u4e0e\u6302\u8d77\u64cd\u4f5c\u5bf9\u5e94\u7684\u64cd\u4f5c\u662f\u6fc0\u6d3b<\/strong>\u64cd\u4f5c\u3002<\/p>\n \uff081\uff09\u7ec8\u7aef\u7528\u6237\u7684\u9700\u8981<\/strong>\uff1a\u5f53\u7ec8\u7aef\u7528\u6237\u5728\u81ea\u5df1\u7684\u7a0b\u5e8f\u8fd0\u884c\u671f\u95f4\u53d1\u73b0\u6709\u53ef\u7591\u95ee\u9898\uff0c\u5e0c\u671b\u6682\u505c\u81ea\u5df1\u7684\u7a0b\u5e8f\u7684\u6267\u884c\uff0c\u4f7f\u4e4b\u505c\u4e0b\u6765\uff0c\u4ee5\u4fbf\u7814\u7a76\u4fee\u6539\u3002<\/p>\n \uff082\uff09\u7236\u8fdb\u7a0b\u8bf7\u6c42<\/strong>\uff1a\u6709\u65f6\u7236\u8fdb\u7a0b\u5e0c\u671b\u6302\u8d77\u81ea\u5df1\u7684\u67d0\u4e2a\u5b50\u8fdb\u7a0b\uff0c\u4ee5\u4fbf\u8003\u67e5\u548c\u4fee\u6539\u8be5\u5b50\u8fdb\u7a0b\uff0c\u6216\u8005\u534f\u8c03\u5404\u5b50\u8fdb\u7a0b\u95f4\u7684\u6d3b\u52a8\u3002<\/p>\n \uff083\uff09\u8d1f\u8377\u8c03\u8282\u7684\u9700\u8981<\/strong>\uff1a\u5f53\u5b9e\u65f6\u7cfb\u7edf\u4e2d\u7684\u5de5\u4f5c\u8d1f\u8377\u8f83\u91cd\uff0c\u5df2\u53ef\u80fd\u5f71\u54cd\u5230\u5bf9\u5b9e\u65f6\u4efb\u52a1\u7684\u63a7\u5236\u65f6\uff0c\u53ef\u7531\u7cfb\u7edf\u628a\u4e00\u4e9b\u4e0d\u91cd\u8981\u7684\u8fdb\u7a0b\u6302\u8d77\uff0c\u4ee5\u4fdd\u8bc1\u7cfb\u7edf\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n \uff084\uff09\u64cd\u4f5c\u7cfb\u7edf\u7684\u9700\u8981<\/strong>\uff1a\u64cd\u4f5c\u7cfb\u7edf\u6709\u65f6\u5e0c\u671b\u6302\u8d77\u67d0\u4e9b\u8fdb\u7a0b\uff0c\u4ee5\u4fbf\u68c0\u67e5\u8fd0\u884c\u4e2d\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u6216\u8fdb\u884c\u8bb0\u8d26\u3002<\/p>\n \u5728\u5f15\u5165\u6302\u8d77\u539f\u8bed Suspend \u548c\u6fc0\u6d3b\u539f\u8bed Active \u540e,\u5728\u5b83\u4eec\u7684\u4f5c\u7528\u4e0b,\u8fdb\u7a0b\u5c06\u53ef\u80fd\u53d1\u751f\u4ee5\u4e0b\u51e0\u79cd\u72b6\u6001\u7684\u8f6c\u6362: <\/p>\n<\/p>\n \u5982\u56fe2-8\u793a\u51fa\u4e86\u589e\u52a0\u4e86\u521b\u5efa\u72b6\u6001\u548c\u7ec8\u6b62\u72b6\u5fd7\u540e\u5177\u6709\u6302\u8d77\u72b6\u6001\u7684\u8fdb\u7a0b\u72b6\u6001\u53ca\u8f6c\u6362\u56fe\u3002 (2\uff09\u521b\u5efa\u4e00\u6d3b\u52a8\u5c31\u7eea<\/strong>\uff1a\u5728\u5f53\u524d\u7cfb\u7edf\u7684\u6027\u80fd\u548c\u5185\u5b58\u7684\u5bb9\u91cf\u5747\u5141\u8bb8\u7684\u60c5\u51b5\u4e0b\uff0c\u5b8c\u6210\u5bf9\u8fdb\u7a0b\u521b\u5efa\u7684\u5fc5\u8981\u64cd\u4f5c\u540e\uff0c\u76f8\u5e94\u7684\u7cfb\u7edf\u8fdb\u7a0b\u5c06\u8fdb\u7a0b\u7684\u72b6\u6001\u8f6c\u6362\u4e3a\u6d3b\u52a8\u5c31\u7eea\u72b6\u6001\u3002 \u4fe1\u53f7\u91cf\uff08Saphore\uff09\u7531\u4e00\u4e2a\u503c\u548c\u4e00\u4e2a\u6307\u9488\u7ec4\u6210\uff0c\u6307\u9488\u6307\u5411\u7b49\u5f85\u8be5\u4fe1\u53f7\u91cf\u7684\u8fdb\u7a0b\uff0c\u4fe1\u53f7\u91cf\u7684\u503c\u8868\u793a\u76f8\u5e94\u8d44\u6e90\u7684\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n \u4fe1\u53f7\u91cf \u4fe1\u53f7\u91cf \u82e5 \u4fe1\u53f7\u91cf\u7684\u503c\u53ea\u80fd\u901a\u8fc7PV\u64cd\u4f5c<\/strong>\u6765\u6539\u53d8\u3002<\/p>\n PV\u64cd\u4f5c<\/strong>\uff1a\u4e00\u79cd\u5b9e\u73b0\u8fdb\u7a0b\u4e92\u65a5\u4e0e\u540c\u6b65<\/strong>\u7684\u6709\u6548\u65b9\u6cd5\uff0c\u5305\u542bP\u64cd\u4f5c\u4e0eV\u64cd\u4f5c\u3002<\/p>\n P\u64cd\u4f5c<\/strong>\uff1a\u4f7f V\u64cd\u4f5c<\/strong>\uff1a\u4f7f \u4e34\u754c\u8d44\u6e90\uff1a\u540c\u4e00\u65f6\u523b\u53ea\u5141\u8bb8\u4e00\u4e2a\u8fdb\u7a0b\u8bbf\u95ee\u7684\u8d44\u6e90\uff0c\u4e0e\u4e0a\u9762\u6240\u8bf4\u7684 \u4e3a\u4f7f\u591a\u4e2a\u53d8\u91cf\u80fd\u4e92\u65a5\u5730\u8fdb\u884c\u8bbf\u95ee\u67d0\u4e34\u754c\u8d44\u6e90\uff0c\u53ea\u9700\u8981\u4e3a\u8be5\u8d44\u6e90\u8bbe\u7f6e\u4e00\u4e92\u65a5\u53d8\u91cfmutex\uff0c\u5e76\u8bbe\u5176\u521d\u59cb\u503c\u4e3a1\uff0c\u7136\u540e\u5c06\u5404\u8fdb\u7a0b\u8bbf\u95ee\u8be5\u8d44\u6e90\u7684\u4e34\u754c\u533aCS\u7f6e\u4e8ewait(mutex)\u548csignal(mutex)\u64cd\u4f5c\u4e4b\u95f4\u5373\u53ef\u3002<\/p>\n wait(mutex)\u548csignal(mutex)\u5fc5\u987b\u6210\u5bf9\u51fa\u73b0<\/strong>\u3002\u7f3a\u5c11wait(mutex)\u5c06\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u6df7\u4e71\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5bf9\u4e34\u754c\u8d44\u6e90\u7684\u4e92\u65a5\u8bbf\u95ee\uff1b\u800c\u7f3a\u5c11signal(mutex)\u5c06\u4f1a\u4f7f\u4e34\u754c\u8d44\u6e90\u6c38\u8fdc\u4e0d\u88ab\u91ca\u653e\uff0c\u4ece\u800c\u4f7f\u56e0\u7b49\u5f85\u8be5\u8d44\u6e90\u800c\u963b\u585e\u7684\u8fdb\u7a0b\u4e0d\u80fd\u88ab\u5524\u9192\u3002<\/p>\n \uff08\u6b64\u5904\u5efa\u8bae\u7ed3\u5408\u8d85\u5e02\u51fa\u5165\u53e3\u7684\u9898\u76ee\u8fdb\u884c\u7406\u89e3\uff09<\/p>\n<\/p>\n \u4e3a\u4e86\u5b9e\u73b0\u94f6\u884c\u5bb6\u7b97\u6cd5\uff0c\u5728\u7cfb\u7edf\u4e2d\u5fc5\u987b\u8bbe\u7f6e\u8fd9\u6837\u56db\u4e2a\u6570\u636e\u7ed3\u6784\uff0c\u5206\u522b\u7528\u6765\u63cf\u8ff0\u7cfb\u7edf\u4e2d\u53ef\u5229\u7528\u7684\u8d44\u6e90\u3001\u6240\u6709\u8fdb\u7a0b\u5bf9\u8d44\u6e90\u7684\u6700\u5927\u9700\u6c42\u3001\u7cfb\u7edf\u4e2d\u7684\u8d44\u6e90\u5206\u914d\uff0c\u4ee5\u53ca\u6240\u6709\u8fdb\u7a0b\u8fd8\u9700\u8981\u591a\u5c11\u8d44\u6e90\u7684\u60c5\u51b5\u3002 \u671f\u672b\u4e0d\u6302\u79d1\u4e4b\u94f6\u884c\u5bb6\u7b97\u6cd5\u89e3\u9898\u6b65\u9aa4(\u4e00)_\u54d4\u54e9\u54d4\u54e9_bilibili<\/p>\n \u64cd\u4f5c\u7cfb\u7edf\u4e4b\u671f\u672b\u4e0d\u6302\u79d1-\u94f6\u884c\u5bb6\u7b97\u6cd5\u89e3\u9898\u6b65\u9aa4(\u4e8c)_\u54d4\u54e9\u54d4\u54e9_bilibili<\/p>\n \u5e38\u7528\u8ba1\u7b97\u57fa\u7840\u65f6\u95f4\u516c\u5f0f\uff1a<\/strong><\/p>\n <\/span><\/strong>\u5468\u8f6c\u65f6\u95f4=\u4f5c\u4e1a\u5b8c\u6210\u65f6\u523b\u2014\u4f5c\u4e1a\u5230\u8fbe\u65f6\u523b\uff1b<\/span><\/span><\/p>\n \u5e26\u6743\u5468\u8f6c\u65f6\u95f4=\u5468\u8f6c\u65f6\u95f4\/\u670d\u52a1\u65f6\u95f4\uff1b<\/span><\/span><\/p>\n \u5e73\u5747\u5468\u8f6c\u65f6\u95f4=\u4f5c\u4e1a\u5468\u8f6c\u603b\u65f6\u95f4\/\u4f5c\u4e1a\u4e2a\u6570\uff1b<\/span><\/span><\/p>\n \u5e73\u5747\u5e26\u6743\u5468\u8f6c\u65f6\u95f4=\u5e26\u6743\u5468\u8f6c\u603b\u65f6\u95f4\/\u4f5c\u4e1a\u4e2a\u6570\uff1b<\/span><\/span><\/p>\n \u65e2\u53ef\u7528\u4e8e\u4f5c\u4e1a\u8c03\u5ea6\uff0c\u4e5f\u53ef\u7528\u4e8e\u8fdb\u7a0b\u8c03\u5ea6\u3002\u91c7\u7528\u8be5\u7b97\u6cd5\u65f6\uff0c\u7cfb\u7edf\u5c06\u6309\u7167\u4f5c\u4e1a\u5230\u8fbe\u7684\u5148\u540e\u6b21\u5e8f\u6765\u8fdb\u884c\u8c03\u5ea6\u3002<\/p>\n \u53ea\u8003\u8651\u4e13\u4f5c\u4e1a\u7684\u7b49\u5f85\u65f6\u95f4\uff0c\u800c\u5ffd\u89c6\u4e86\u4f5c\u4e1a\u7684\u8fd0\u884c\u65f6\u95f4\u3002<\/p>\n \u4ee5\u4f5c\u4e1a\u7684\u957f\u77ed<\/strong>\u6765\u8ba1\u7b97\u4f18\u5148\u7ea7\uff0c\u4f5c\u4e1a\u8d8a\u77ed\uff0c\u4f18\u5148\u7ea7\u8d8a\u9ad8<\/strong>\u3002\u4f5c\u4e1a\u7684\u957f\u77ed\u4ee5\u4f5c\u4e1a\u6240\u8981\u6c42\u7684\u8fd0\u884c\u65f6\u95f4\u6765\u8861\u91cf\u3002SJF\u7b97\u6cd5\u53ef\u4ee5\u5206\u522b\u7528\u4e8e\u4f5c\u4e1a\u8c03\u5ea6\u548c\u8fdb\u7a0b\u8c03\u5ea6\u3002<\/p>\n \u53ea\u8003\u8651\u4f5c\u4e1a\u7684\u8fd0\u884c\u65f6\u95f4\uff0c\u800c\u5ffd\u89c6\u4e86\u4f5c\u4e1a\u7684\u7b49\u5f85\u65f6\u95f4\u3002<\/p>\n \u7f3a\u70b9<\/strong>\uff1a<\/p>\n \uff081\uff09\u5fc5\u987b\u9884\u77e5\u4f5c\u4e1a\u7684\u65f6\u95f4\u3002<\/p>\n \uff082\uff09\u5bf9\u957f\u4f5c\u4e1a\u975e\u5e38\u4e0d\u5229<\/strong>\uff0c\u957f\u4f5c\u4e1a\u7684\u5468\u8f6c\u65f6\u95f4\u4f1a\u660e\u663e\u5730\u589e\u957f\u3002<\/p>\n \uff083\uff09\u91c7\u7528SJF\u7b97\u6cd5\u65f6\uff0c\u4eba\u2014\u673a\u65e0\u6cd5\u5b9e\u73b0\u4ea4\u4e92\u3002<\/p>\n \uff084\uff09\u8be5\u8c03\u5ea6\u7b97\u6cd5\u5b8c\u5168\u672a\u8003\u8651\u4f5c\u4e1a\u7684\u7d27\u8feb\u7a0b\u5ea6<\/strong>\uff0c\u6545\u4e0d\u80fd\u4fdd\u8bc1\u7d27\u8feb\u6027\u4f5c\u4e1a\u80fd\u5f97\u5230\u53ca\u65f6\u5904\u7406\u3002<\/p>\n \u57fa\u4e8e\u4f5c\u4e1a\u7684\u7d27\u8feb\u7a0b\u5ea6\uff0c\u7531\u5916\u90e8\u8d4b\u4e88\u4f5c\u4e1a\u7684\u4f18\u5148\u7ea7\uff0c\u8c03\u5ea6\u7b97\u6cd5\u6839\u636e\u8be5\u4f18\u5148\u7ea7\u8fdb\u884c\u8c03\u5ea6\u3002<\/p>\n \u65e2\u53ef\u4f5c\u4e3a\u4f5c\u4e1a\u8c03\u5ea6\u7b97\u6cd5\uff0c\u4e5f\u53ef\u4f5c\u4e3a\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3002<\/p>\n \u6bcf\u4e2a\u4f5c\u4e1a\u5f15\u5165\u4e00\u4e2a\u52a8\u6001\u4f18\u5148\u7ea7\uff0c\u5373\u4f18\u5148\u7ea7\u662f\u53ef\u4ee5\u6539\u53d8\u7684\uff0c\u4ee4\u5b83\u968f\u7b49\u5f85\u65f6\u95f4\u5ef6\u957f\u800c\u589e\u52a0\uff0c\u8fd9\u4f7f\u957f\u4f5c\u4e1a\u7684\u4f18\u5148\u7ea7\u5728\u7b49\u5f85\u671f\u95f4\u4e0d\u65ad\u5730\u589e\u52a0\u3002<\/p>\n \u4f18\u5148\u6743=\uff08\u7b49\u5f85\u65f6\u95f4+\u8981\u6c42\u670d\u52a1\u65f6\u95f4\uff09\/\u8981\u6c42\u7b49\u5f85\u670d\u52a1\u65f6\u95f4<\/strong><\/u><\/p>\n \u7531\u4e8e\u7b49\u5f85\u65f6\u95f4\u4e0e\u670d\u52a1\u65f6\u95f4\u4e4b\u548c\u5c31\u662f\u7cfb\u7edf\u5bf9\u8be5\u4f5c\u4e1a\u7684\u54cd\u5e94\u65f6\u95f4\uff0c\u6545\u8be5\u4f18\u5148\u7ea7\u53c8\u76f8\u5f53\u4e8e\u76f8\u5e94\u6bd4Rp\u3002\u636e\u6b64\uff0c\u4f18\u5148\u53c8\u53ef\u8868\u793a\u4e3a\uff1a<\/p>\n Rp=\uff08\u7b49\u5f85\u65f6\u95f4+\u8981\u6c42\u670d\u52a1\u65f6\u95f4\uff09\/\u8981\u6c42\u670d\u52a1\u65f6\u95f4=\u54cd\u5e94\u65f6\u95f4\/\u8981\u6c42\u670d\u52a1\u65f6\u95f4<\/u><\/strong><\/p>\n =\uff08\u7b49\u5f85\u65f6\u95f4\/\u8981\u6c42\u670d\u52a1\u65f6\u95f4\uff09+1<\/span><\/u><\/strong><\/p>\n \u7531\u6b64\u53ef\u4ee5\u770b\u51fa\uff1a <\/p>\n \uff081\uff09\u5982\u679c\u4f5c\u4e1a\u7684\u7b49\u5f85\u65f6\u95f4\u76f8\u540c\uff0c\u5219\u8981\u6c42\u670d\u52a1\u7684\u65f6\u95f4\u8d8a\u77ed\uff0c\u5176\u4f18\u5148\u6743\u8d8a\u9ad8\uff0c\u7c7b\u4f3c\u4e8eSJF\u7b97\u6cd5\uff0c\u6709\u5229\u4e8e\u77ed\u4f5c\u4e1a\u3002<\/p>\n \uff082\uff09\u5f53\u8981\u6c42\u670d\u52a1\u7684\u65f6\u95f4\u540c\u65f6\uff0c\u4f5c\u4e1a\u7684\u4f18\u5148\u6743\u53c8\u51b3\u5b9a\u4e8e\u5176\u7b49\u5f85\u65f6\u95f4\uff0c\u56e0\u800c\u53c8\u7c7b\u4f3c\u4e8eFCFS\u7b97\u6cd5\u3002<\/p>\n \uff083\uff09\u5bf9\u4e8e\u957f\u4f5c\u4e1a\u7684\u4f18\u5148\u7ea7\uff0c\u53ef\u4ee5\u968f\u7b49\u5f85\u65f6\u95f4\u7684\u589e\u52a0\u800c\u589e\u9ad8\u3002<\/p>\n<\/p>\n \u6700\u4f73\u7f6e\u6362\u7b97\u6cd5<\/strong>\uff08OPT\uff09\uff1a\u9009\u62e9\u6dd8\u6c70\u7684\u9875\u9762\u5c06\u662f\u4ee5\u540e\u6c38\u8fdc\u4e0d\u518d\u4f7f\u7528<\/strong>\uff0c\u6216\u8005\u662f\u5728\u5c06\u6765\u6700\u957f\u65f6\u95f4\u5185\u4e0d\u518d\u88ab\u8bbf\u95ee<\/strong>\u7684\u9875\u9762\uff0c\u8fd9\u6837\u4ea7\u751f\u7684\u7f3a\u9875\u4e2d\u65ad\u6b21\u6570\u662f\u6700\u5c11\u7684\u3002<\/p>\n \u5148\u8fdb\u5148\u51fa\u7f6e\u6362\u7b97\u6cd5<\/strong>\uff08FIFO\uff09\uff1a\u603b\u662f\u6dd8\u6c70\u6700\u5148\u8fdb\u5165<\/strong>\u5185\u5b58\u7684\u9875\u9762\uff0c\u5373\u9009\u62e9\u5728\u5185\u5b58\u4e2d\u9a7b\u7559\u65f6\u95f4\u6700\u4e45\u7684\u9875\u9762\u4e88\u4ee5\u6dd8\u6c70\u3002<\/p>\n \u6700\u8fd1\u6700\u4e45\u672a\u4f7f\u7528\u7b97\u6cd5<\/strong>\uff08LRU\uff09\uff1a\u6839\u636e\u9875\u9762\u8c03\u5165\u5185\u5b58\u540e\u7684\u4f7f\u7528\u60c5\u51b5\u505a\u51fa\u51b3\u7b56\uff0c\u9009\u62e9\u6700\u8fd1\u6700\u4e45\u672a\u4f7f\u7528<\/strong>\u7684\u9875\u9762\u4e88\u4ee5\u6dd8\u6c70\u3002<\/p>\n \u6700\u5c11\u4f7f\u7528\u7f6e\u6362\u7b97\u6cd5<\/strong>\uff08LFU\uff09\uff1a\u9009\u62e9\u5728\u6700\u8fd1\u65f6\u95f4\u4f7f\u7528\u6700\u5c11<\/strong>\u7684\u9875\u9762\u4f5c\u4e3a\u6dd8\u6c70\u9875\u3002<\/p>\n <\/p>\n \uff08\u6b64\u5904\u8981\u6c42\u4f1a\u8ba1\u7b97\u7f3a\u9875\u7387\u3001\u7f3a\u9875\u4e2d\u65ad\u6b21\u6570\uff09<\/strong><\/p>\n<\/p>\n \u4f8b<\/em>\uff1a\u82e5\u9875\u9762\u5927\u5c0fL\uff08\u9875\u9762\u5927\u5c0f\u662f2\u7684\u6574\u6570\u5e42<\/u>\uff09<\/strong>\u4e3a1K<\/strong>\u5b57\u8282\uff0c\u9875\u53f72\u5bf9\u5e94\u7684\u5185\u5b58\u5757\u53f7b=8\uff0c\u5c06\u903b\u8f91\u5730\u5740A=2500<\/strong>\u8f6c\u6362\u4e3a\u7269\u7406\u5730\u5740E\u3002 \u53c2\u8003\u5b66\u4e60\uff1a \u57fa\u672c\u5206\u9875\u5b58\u50a8\u7ba1\u7406\uff1a<\/p>\n \u5047\u8bbe\u8bbf\u95ee\u4e00\u6b21\u5185\u5b58\u7684\u65f6\u95f4\u4e3at\uff0c\u5728\u57fa\u672c\u5206\u9875\u5b58\u50a8\u7ba1\u7406\u65b9\u5f0f\u4e2d\uff0c\u6709\u6548\u8bbf\u95ee\u65f6\u95f4\u5206\u4e3a\u7b2c\u4e00\u6b21\u8bbf\u95ee\u5185\u5b58\u65f6\u95f4\uff08\u5373\u67e5\u627e\u9875\u8868\u5bf9\u5e94\u7684\u9875\u8868\u9879\u6240\u8017\u8d39\u7684\u65f6\u95f4t\uff09\u4e0e\u7b2c\u4e8c\u6b21\u8bbf\u95ee\u5185\u5b58\u65f6\u95f4\uff08\u5373\u5c06\u9875\u8868\u9879\u4e2d\u7684\u7269\u7406\u5757\u53f7\u4e0e\u9875\u5185\u5730\u5740\u62fc\u63a5\u6210\u5b9e\u9645\u7269\u7406\u5730\u5740\u6240\u8017\u8d39\u7684\u65f6\u95f4t\uff09\u4e4b\u548c\uff1a<\/p>\n EAT=t+t=2t<\/strong><\/p>\n \u5305\u542b\u5feb\u8868<\/strong>\uff08TLB\uff09\u7684\u5206\u9875\u5b58\u50a8\u7ba1\u7406\uff1a<\/p>\n \u5728\u5f15\u5165\u5feb\u8868\u7684\u5206\u9875\u5b58\u50a8\u7ba1\u7406\u65b9\u5f0f\u4e2d\u901a\u8fc7\u5feb\u8868\u67e5\u8be2\u53ef\u4ee5\u76f4\u63a5\u5f97\u5230\u903b\u8f91\u9875\u6240\u5bf9\u5e94\u7684\u7269\u7406\u5757\u53f7\uff0c\u7531\u6b64\u62fc\u63a5\u5f62\u6210\u5b9e\u9645\u7269\u7406\u5730\u5740\uff0c\u51cf\u5c11\u4e86\u4e00\u6b21\u8bbf\u95ee\u5185\u5b58\u7684\u65f6\u95f4\uff0c\u7f29\u77ed\u4e86\u8fdb\u7a0b\u8bbf\u95ee\u5185\u5b58\u7684\u6709\u6548\u65f6\u95f4\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u5feb\u8868\u7684\u5bb9\u91cf\u9650\u5236\uff0c\u4e0d\u53ef\u80fd\u5c06\u4e00\u4e2a\u8fdb\u7a0b\u7684\u6574\u4e2a\u9875\u5168\u90e8\u88c5\u5165\u5feb\u8868\uff0c\u6240\u4ee5\u5728\u5feb\u8868\u4e2d\u67e5\u627e\u6240\u9700\u8868\u9879\u5b58\u5728\u547d\u4e2d\u7387\u7684\u95ee\u9898\u3002<\/p>\n \u547d\u4e2d\u7387\uff1a\u4f7f\u7528\u5feb\u8868\u5e76\u5728\u5176\u4e2d\u6210\u529f\u627e\u5230\u6240\u9700\u9875\u9762\u7684\u8868\u9879\u7684\u6bd4\u7387\u3002<\/p>\n \u5f15\u5165\u5feb\u8868\u7684\u5206\u9875\u5b58\u50a8\u7ba1\u7406\u65b9\u5f0f\u4e2d\uff0c\u6709\u6548\u8bbf\u95ee\u65f6\u95f4\u8ba1\u7b97\u516c\u5f0f\u5373\u4e3a\uff1a<\/p>\n EAT=a*\u03bb+(t+\u03bb)(1-a)+t=2t-t*a<\/strong><\/p>\n \u4e0a\u5f0f\u4e2d\uff0c\u03bb<\/strong>\u8868\u793a\u67e5\u627e\u5feb\u8868\u6240\u9700\u8981\u7684\u65f6\u95f4<\/strong>\uff0ca<\/strong>\u8868\u793a\u547d\u4e2d\u7387<\/strong>\uff0ct<\/strong>\u8868\u793a\u8bbf\u95ee\u4e00\u6b21\u5185\u5b58\u6240\u9700\u8981\u7684\u65f6\u95f4<\/strong>\u3002<\/p>\n a*\u03bb<\/strong>:\u521a\u597d\u5728\u5feb\u8868\u4e2d\u627e\u5230\u6240\u9700\u8868\u9879\uff1b<\/p>\n (t+\u03bb)(1-a)<\/strong>:\u5728\u5feb\u8868\u4e2d\u672a\u627e\u5230\u6240\u9700\u8868\u9879\uff0c\u9700\u8981\u5728\u5feb\u8868\u5916\u67e5\u627e\u82b1\u8d39\u65f6\u95f4t\uff0c\u6982\u7387\u4e3a1-a;<\/p>\n t<\/strong>:\u62fc\u63a5\u6210\u5b9e\u9645\u7269\u7406\u5730\u5740\u82b1\u8d39\u65f6\u95f4\u3002<\/p>\n \u4f8b<\/em>\uff1a\u4e00\u5177\u6709\u5feb\u8868\u7684\u5206\u9875\u7cfb\u7edf\u4e2d\uff0c\u903b\u8f91\u5730\u5740\u8bbf\u95ee\u5185\u5b58\u7684\u65f6\u95f4\u662f100\u6beb\u79d2\uff0c\u8bbf\u95ee\u5feb\u8868\u7684\u65f6\u95f4\u662f20\u6beb\u79d2\u3002<\/p>\n \u3000\u3000 \u95ee\uff1a\u8bbe\u4ece\u5feb\u8868\u4e2d\u67e5\u627e\u5230\u6240\u9700\u9875\u8868\u9879\u7684\u6982\u7387\u4e3a85%\uff0c\u8ba1\u7b97CPU\u5b58\u53d6\u4e00\u4e2a\u6570\u636e\u65f6\u7684\u6709\u6548\u8bbf\u95ee\u65f6\u95f4\u3002<\/p>\n \u3000\u3000 ETA = \u03b1 x \u03bb + ( t + \u03bb )( 1 - \u03b1 ) + t<\/p>\n \u3000\u3000\u3000 = 20 x 0.85 + ( 100 + 20 )( 1 - 0.85 ) + 100<\/p>\n \u3000\u3000\u3000 = 135<\/p>\n \u6216 ETA = 2t + \u03bb -t x \u03b1<\/p>\n \u3000\u3000 \u3000 = 2 x 100 + 20 - 100 x 0.85<\/p>\n \u3000\u3000 = 135<\/p>\n<\/p>\n \uff081\uff09\u7f13\u548cCPU\u4e0eI\/O\u8bbe\u5907\u95f4\u901f\u5ea6\u4e0d\u5339\u914d\u7684\u77db\u76fe\uff1b<\/p>\n \uff082\uff09\u51cf\u5c11CPU\u7684\u4e2d\u65ad\u9891\u7387\uff0c\u653e\u5bbd\u5bf9CPU\u4e2d\u65ad\u54cd\u5e94\u65f6\u95f4\u7684\u9650\u5236\uff1b<\/p>\n \uff083\uff09\u89e3\u51b3\u6570\u636e\u7c92\u5ea6\u4e0d\u5339\u914d\u7684\u95ee\u9898\uff1b<\/p>\n \uff084\uff09\u63d0\u9ad8CPU\u548cI\/O\u8bbe\u5907\u4e4b\u95f4\u7684\u5e76\u884c\u6027\u3002<\/p>\n \u3000 \u6bcf\u5f53\u7528\u6237\u8fdb\u7a0b\u53d1\u51fa\u4e00\u4e2aI\/O\u8bf7\u6c42\u65f6\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4fbf\u5728\u4e3b\u5b58\u4e2d\u4e3a\u4e4b\u5206\u914d\u4e00\u4e2a\u7f13\u51b2\u533a\uff0c\u5047\u5b9a\u4ece\u78c1\u76d8\u628a\u4e00\u5757\u6570\u636e\u8f93\u5165\u5230\u7f13\u51b2\u533a\u7684\u65f6\u95f4\u4e3aT\uff0c\u64cd\u4f5c\u7cfb\u7edf\u5c06\u8be5\u7f13\u51b2\u533a\u4e2d\u7684\u6570\u636e\u4f20\u9001\u5230\u7528\u6237\u533a\u7684\u65f6\u95f4\u4e3aM\uff0c\u800cCPU\u5bf9\u8fd9\u4e00\u5757\u6570\u636e\u5904\u7406\uff08\u8ba1\u7b97\uff09\u7684\u65f6\u95f4\u4e3aC\uff0c\u7531\u4e8eT\u548cC\u662f\u53ef\u4ee5\u5e76\u884c\u7684\uff0c\u5f53T>C<\/strong>\u65f6\uff0c\u7cfb\u7edf\u5bf9\u6bcf\u4e00\u5757\u6570\u636e\u7684\u5904\u7406\u65f6\u95f4\u4e3aM+T<\/strong>\uff0c\u53cd\u4e4b\uff0c\u4e3a \u4e00\u3001\u6b7b\u9501\u7684\u6982\u5ff5\u548c\u6b7b\u9501\u7684\u539f\u56e0\u3001\u6b7b\u9501\u7684\u5fc5\u8981\u6761\u4ef6<\/strong><\/h2>\n
1\u3001\u6b7b\u9501\u6982\u5ff5<\/h4>\n
2\u3001\u89e3\u51b3\u6b7b\u9501\u7684\u65b9\u6cd5<\/h4>\n
\u4e8c\u3001\u8fdb\u7a0b\u7684\u57fa\u672c\u72b6\u6001\u5206\u6790<\/strong><\/h2>\n
1\u3001\u8fdb\u7a0b\u7684\u5b9a\u4e49\uff1a\u6307\u4e00\u4e2a\u5177\u6709\u72ec\u7acb\u529f\u80fd\u7684\u7a0b\u5e8f\u5bf9\u67d0\u4e2a\u6570\u636e\u96c6\u5728\u5904\u7406\u673a\u4e0a\u7684\u6267\u884c\u8fc7\u7a0b\u548c\u5206\u914d\u8d44\u6e90\u7684\u57fa\u672c\u5355\u4f4d<\/strong>\u3002<\/h3>\n
2\u3001\u4e09\u79cd\u57fa\u672c\u72b6\u6001<\/h3>\n
3\u3001\u521b\u5efa\u72b6\u6001\u548c\u7ec8\u6b62\u72b6\u6001<\/h3>\n
4\u3001\u6302\u8d77\u64cd\u4f5c\u548c\u8fdb\u7a0b\u72b6\u6001\u7684\u8f6c\u6362<\/h3>\n
\n 4.1\u6302\u8d77\u64cd\u4f5c\u5f15\u5165\u539f\u56e0\uff1a<\/em><\/h4>\n
\n 4.2\u5f15\u5165\u6302\u8d77\u539f\u8bed\u64cd\u4f5c\u540e\u4e09\u4e2a\u8fdb\u7a0b\u72b6\u6001\u7684\u8f6c\u6362\uff1a<\/em><\/h4>\n
(1) \u6d3b\u52a8\u5c31\u7eea\u4e00\u9759\u6b62\u5c31\u7eea<\/strong>\uff1a\u5f53\u8fdb\u7a0b\u5904\u4e8e\u672a\u88ab\u6302\u8d77\u7684\u5c31\u7eea\u72b6\u6001\u65f6,\u79f0\u6b64\u4e3a\u6d3b\u52a8\u5c31\u7eea\u72b6\u6001,\u8868\u793a\u4e3a Readya ,\u6b64\u65f6\u8fdb\u7a0b\u53ef\u4ee5\u63a5\u53d7\u8bad\u5ea6\u3002\u5f53\u7528\u6302\u8d77\u539f\u8bed Suspend \u5c06\u8be5\u8fdb\u7a0b\u6302\u8d77\u540e,\u8be5\u8fdb\u7a0b\u4fbf\u8f6c\u53d8\u4e3a\u9759\u6b62\u5c31\u7eea\u72b6\u6001,\u8868\u793a\u4e3a Readys ,\u5904\u4e8e Readys \u72b6\u6001\u7684\u8fdb\u7a0b\u4e0d\u518d\u88ab\u8c03\u5ea6\u6267\u884c\u3002
(2) \u6d3b\u52a8\u963b\u585e\u4e00\u9759\u6b62\u963b\u585e\uff1a<\/strong>\u5f53\u8fdb\u7a0b\u5904\u4e8e\u672a\u88ab\u6302\u8d77\u7684\u963b\u585e\u72b6\u6001\u65f6,\u79f0\u5b83\u662f\u5904\u4e8e\u6d3b\u52a8\u963b\u585e\u72b6\u6001,\u8868\u793a\u4e3a Blockeda \u3002\u5f53\u7528 Suspend \u539f\u8bed\u5c06\u5b83\u6302\u8d77\u540e,\u8fdb\u7a0b\u4fbf\u8f6c\u53d8\u4e3a\u9759\u6b62\u963b\u585e\u72b6\u6001,\u8868\u793a\u4e3a Blockeds \u3002\u5904\u4e8e\u8be5\u72b6\u6001\u7684\u8fdb\u7a0b\u5728\u5176\u6240\u671f\u5f85\u7684\u4e8b\u4ef6\u51fa\u73b0\u540e,\u5b83\u5c06\u4ece\u9759\u6b62\u963b\u585e\u53d8\u4e3a\u9759\u6b62\u5c31\u7eea Readys \u72b6\u6001\u3002
(3) \u9759\u6b62\u5c31\u7eea\u4e00\u6d3b\u52a8\u5c31\u7eea<\/strong>\uff1a\u5904\u4e8e Readys \u72b6\u6001\u7684\u8fdb\u7a0b\u82e5\u7528\u6fc0\u6d3b\u539f\u8bed Active \u6fc0\u6d3b\u540e,\u8be5\u8fdb\u7a0b\u5c06\u8f6c\u53d8\u4e3a Readya \u72b6\u6001\u3002
(4) \u9759\u6b62\u963b\u585e\u4e00\u6d3b\u52a8\u963b\u585e<\/strong>\uff1a\u5904\u4e8e Blockeds \u72b6\u6001\u7684\u8fdb\u7a0b\u82e5\u7528\u6fc0\u6d3b\u539f\u8bed Active \u6fc0\u6d3b\u540e,\u8fdb\u7a0b\u5c06\u8f6c\u53d8\u4e3a Blockeda \u72b6\u6001\u3002\u56fe2-7\u793a\u51fa\u4e86\u5177\u6709\u6302\u8d77\u72b6\u6001\u7684\u8fdb\u7a0b\u72b6\u6001\u56fe\u3002<\/p>\n 4.3\u5f15\u5165\u6302\u8d77\u64cd\u4f5c\u540e\u4e94\u4e2a\u8fdb\u7a0b\u72b6\u6001\u7684\u8f6c\u6362\uff1a<\/h4>\n
\u5982\u56fe2-8\u6240\u793a,\u5f15\u8fdb\u521b\u5efa\u548c\u7ec8\u6b62\u72b6\u6001\u540e,\u5728\u8fdb\u7a0b\u72b6\u6001\u8f6c\u6362\u65f6,\u4e0e\u56fe2-7\u6240\u793a\u7684\u8fdb\u7a0b\u4e94\u72b6\u6001\u8f6c\u6362\u76f8\u6bd4\u8f83,\u8981\u589e\u52a0\u8003\u8651\u4e0b\u9762\u7684\u51e0\u79cd\u60c5\u51b5\uff1a
(1) NULL \u4e00\u521b\u5efa<\/strong>\uff1a\u4e00\u4e2a\u65b0\u8fdb\u7a0b\u4ea7\u751f\u65f6,\u8be5\u8fdb\u7a0b\u5904\u4e8e\u521b\u5efa\u72b6\u6001\u3002<\/p>\n
(3\uff09\u521b\u5efa\u4e00\u9759\u6b62\u5c31\u7eea<\/strong>\uff1a\u8003\u8651\u5230\u7cfb\u7edf\u5f53\u524d\u8d44\u6e90\u72b6\u51b5\u548c\u6027\u80fd\u7684\u8981\u6c42\uff0c\u4e0d\u5206\u914d\u7ed9\u65b0\u5efa\u8fdb\u7a0b\u6240\u9700\u8d44\u6e90\uff0c\u4e3b\u8981\u662f\u4e3b\u5b58\uff0c\u76f8\u5e94\u7684\u7cfb\u7edf\u5c06\u8fdb\u7a0b\u72b6\u6001\u8f6c\u4e3a\u9759\u6b62\u5c31\u7eea\u72b6\u6001\uff0c\u88ab\u5b89\u7f6e\u5728\u5916\u5b58\uff0c\u4e0d\u53c2\u4e0e\u8c03\u5ea6\uff0c\u6b64\u65f6\u8fdb\u7a0b\u521b\u5efa\u5de5\u4f5c\u5c1a\u672a\u5b8c\u6210\u3002
(4\uff09\u6267\u884c\u4e00\u7ec8\u6b62<\/strong>\uff1a\u5f53\u4e00\u4e2a\u8fdb\u7a0b\u5df2\u5b8c\u6210\u4efb\u52a1\u65f6\uff0c\u6216\u662f\u51fa\u73b0\u4e86\u65e0\u6cd5\u514b\u670d\u7684\u9519\u8bef\uff0c\u6216\u662f\u88ab OS \u6216\u662f\u88ab\u5176\u4ed6\u8fdb\u7a0b\u6240\u7ec8\u7ed3\uff0c\u6b64\u65f6\u5c06\u8fdb\u7a0b\u7684\u72b6\u6001\u8f6c\u6362\u4e3a\u7ec8\u6b62\u72b6\u6001\u3002<\/p>\n<\/p>\n\u4e09\u3001\u5229\u7528\u4fe1\u53f7\u91cf\u8fdb\u884c\u8d44\u6e90\u7684\u540c\u6b65\u548c\u4e92\u65a5\u64cd\u4f5c\u4f2a\u7a0b\u5e8f\u8bbe\u8ba1<\/strong><\/h2>\n
3.1\u4fe1\u53f7\u91cf<\/h4>\n
S>=0<\/code> <\/strong>\u65f6\uff0c
S<\/code> \u8868\u793a\u53ef\u7528\u8d44\u6e90\u7684\u6570\u91cf<\/strong>\uff0c\u6267\u884c\u4e00\u6b21P\u64cd\u4f5c<\/strong>\u610f\u5473\u7740\u8bf7\u6c42\u5206\u914d\u4e00\u4e2a\u8d44\u6e90\uff0c\u56e0\u6b64
S<\/code> \u7684\u503c\u51cf
1<\/code><\/strong> \uff1b<\/p>\n
S<0<\/code><\/strong> \u65f6\uff0c\u8868\u793a\u5df2\u7ecf\u6ca1\u6709\u53ef\u7528\u8d44\u6e90<\/strong>\uff0c
S<\/code> \u7684\u7edd\u5bf9\u503c<\/strong>\u8868\u793a\u5f53\u524d\u7b49\u5f85\u8be5\u8d44\u6e90\u7684\u8fdb\u7a0b\u6570\uff0c\u8bf7\u6c42\u8005\u5fc5\u987b\u7b49\u5f85\u5176\u4ed6\u8fdb\u7a0b\u91ca\u653e\u8be5\u7c7b\u8d44\u6e90\u624d\u80fd\u7ee7\u7eed\u8fd0\u884c\uff0c\u800c\u6267\u884c\u4e00\u4e2aV\u64cd\u4f5c<\/strong>\u610f\u5473\u7740\u91ca\u653e\u4e00\u4e2a\u8d44\u6e90\uff0c\u56e0\u6b64
S<\/code> \u7684\u503c\u52a0
1<\/code><\/strong> \uff1b<\/p>\n
S<0<\/code> <\/strong>\uff0c\u8868\u793a\u6709\u67d0\u4e9b\u8fdb\u7a0b\u6b63\u5728\u7b49\u5f85\u8be5\u8d44\u6e90\uff0c\u56e0\u6b64\u8981\u5524\u9192\u4e00\u4e2a\u7b49\u5f85\u72b6\u6001\u7684\u8fdb\u7a0b\uff0c\u4f7f\u4e4b\u8fd0\u884c\u4e0b\u53bb\u3002<\/p>\n
\n 3.2PV\u64cd\u4f5c<\/h4>\n
S=S-1<\/code> \uff0c\u82e5
S>=0<\/code><\/strong> \uff0c\u5219\u8be5\u8fdb\u7a0b\u7ee7\u7eed\u6267\u884c\uff0c\u5426\u5219\u6392\u5165\u7b49\u5f85<\/strong>\u961f\u5217\u3002<\/p>\n
S=S+1<\/code> \uff0c\u82e5
S>0<\/code><\/strong> ,\u5524\u9192\u7b49\u5f85\u961f\u5217\u4e2d\u7684\u4e00\u4e2a\u8fdb\u7a0b\u3002<\/p>\n
S<\/code> \u6709\u5173\u8054\u3002<\/p>\n
\n 3.3\u4e92\u65a5\u53d8\u91cf<\/h4>\n
\u56db\u3001\u94f6\u884c\u5bb6\u7b97\u6cd5<\/strong><\/h2>\n
4.1\u94f6\u884c\u5bb6\u7b97\u6cd5\u4e2d\u7684\u6570\u636e\u7ed3\u6784 <\/h4>\n
\u3000\u3000(1) \u53ef\u5229\u7528\u8d44\u6e90\u5411\u91cf Available<\/strong>\u3002\u8fd9\u662f\u4e00\u4e2a\u542b\u6709 m \u4e2a\u5143\u7d20\u7684\u6570\u7ec4\uff0c\u5176\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4ee3\u8868\u4e00\u7c7b\u53ef\u5229\u7528\u7684\u8d44\u6e90\u6570\u76ee\uff0c\u5176\u521d\u59cb\u503c\u662f\u7cfb\u7edf\u4e2d\u6240\u914d\u7f6e\u7684\u8be5\u7c7b\u5168\u90e8\u53ef\u7528\u8d44\u6e90\u7684\u6570\u76ee\uff0c\u5176\u6570\u503c\u968f\u8be5\u7c7b\u8d44\u6e90\u7684\u5206\u914d\u548c\u56de\u6536\u800c\u52a8\u6001\u5730\u6539\u53d8\u3002\u5982\u679c Available[j] = K\uff0c\u5219\u8868\u793a\u7cfb\u7edf\u4e2d\u73b0Rj\u7c7b\u8d44\u6e90K\u4e2a\u3002
\u3000\u3000(2) \u6700\u5927\u9700\u6c42\u77e9\u9635Max<\/strong>\u3002\u8fd9\u662f\u4e00\u4e2an x m\u7684\u77e9\u9635\uff0c\u5b83\u5b9a\u4e49\u4e86\u7cfb\u7edf\u4e2dn\u4e2a\u8fdb\u7a0b\u4e2d\u7684\u6bcf\u4e2a\u8fdb\u7a0b\u5bf9m\u7c7b\u8d44\u6e90\u7684\u6700\u5927\u9700\u6c42\u3002\u5982\u679cMax[i,j] = K\uff0c\u5219\u8868\u793a\u8fdb\u7a0bi\u9700\u8981Rj \u7c7b\u8d44\u6e90\u7684\u6700\u5927\u6570\u76ee\u4e3aK\u3002
\u3000\u3000(3) \u5206\u914d\u77e9\u9635 Allocation<\/strong>\u3002\u8fd9\u4e5f\u662f\u4e00\u4e2an x m\u7684\u77e9\u9635\uff0c\u5b83\u5b9a\u4e49\u4e86\u7cfb\u7edf\u4e2d\u6bcf\u4e00\u7c7b\u8d44\u6e90\u5f53\u524d\u5df2\u5206\u914d\u7ed9\u6bcf\u4e00\u8fdb\u7a0b\u7684\u8d44\u6e90\u6570\u3002\u5982\u679c Allocation[i,j] = K\uff0c\u5219\u8868\u793a\u8fdb\u7a0bi\u5f53\u524d\u5df1\u5206\u5f97Rj\u7c7b\u8d44\u6e90\u7684\u6570\u76ee\u4e3aK\u3002
\u3000\u3000(4) \u9700\u6c42\u77e9\u9635Need<\/strong>\u3002\u8fd9\u4e5f\u662f\u4e00\u4e2an\u00d7m\u7684\u77e9\u9635\uff0c\u7528\u4ee5\u8868\u793a\u6bcf\u4e00\u4e2a\u8fdb\u7a0b\u5c1a\u9700\u7684\u5404\u7c7b\u8d44\u6e90\u6570\u3002\u5982\u679cNeed[i,j] = K\uff0c\u5219\u8868\u793a\u8fdb\u7a0bi\u8fd8\u9700\u8981Rj\u7c7b\u8d44\u6e90K\u4e2a\u65b9\u80fd\u5b8c\u6210\u5176\u4efb\u52a1\u3002
\u4e0a\u8ff0\u4e09\u4e2a\u77e9\u9635\u95f4\u5b58\u5728\u4e0b\u8ff0\u5173\u7cfb:
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000Need[i,j] = Max[i,j] - allocation[i, j]<\/strong><\/u><\/p>\n 4.2\u7b97\u6cd5\u793a\u4f8b<\/h4>\n
\u4e94\u3001\u4f5c\u4e1a\u8c03\u5ea6\u7684\u57fa\u672c\u7b97\u6cd5<\/strong><\/h2>\n
5.1\u5148\u6765\u5148\u670d\u52a1\u7b97\u6cd5\uff08FCFS\uff09<\/h4>\n
\n 5.2\u77ed\u4f5c\u4e1a\u4f18\u5148\u8c03\u5ea6\u7b97\u6cd5\uff08SJF\uff09<\/h4>\n
\n 5.3\u4f18\u5148\u7ea7\u8c03\u5ea6\u7b97\u6cd5\uff08PSA\uff09<\/h4>\n
\n 5.4\u9ad8\u54cd\u5e94\u6bd4\u4f18\u5148\u8c03\u5ea6\u7b97\u6cd5\uff08HRRN\uff09<\/h4>\n
\u516d\u3001\u9875\u5f0f\u865a\u62df\u5b58\u50a8\u7ba1\u7406\u673a\u5236\u7684\u4e09\u79cd\u57fa\u672c\u7f6e\u6362\u7b97\u6cd5<\/strong><\/h2>\n
<\/strong>6.1\u6700\u4f73\u7f6e\u6362\u7b97\u6cd5\u548c\u5148\u8fdb\u5148\u51fa\u7f6e\u6362\u7b97\u6cd5<\/h4>\n
\n 6.2\u6700\u8fd1\u6700\u4e45\u672a\u4f7f\u7528\u548c\u6700\u5c11\u4f7f\u7528\u7f6e\u6362\u7b97\u6cd5<\/h4>\n
\n 6.3Clock\u7f6e\u6362\u7b97\u6cd5<\/h4>\n
\u4e03\u3001\u8ba1\u7b97\u8bbf\u95ee\u4e00\u4e2a\u7269\u7406\u5355\u4f4d\u7684\u65f6\u95f4<\/strong><\/h2>\n
7.1\u865a\u62df\u5730\u5740\u548c\u7269\u7406\u5730\u5740\u7684\u8f6c\u6362<\/h4>\n
\u7b49\u4ef7\u63cf\u8ff0\uff1a\u67d0\u7cfb\u7edf\u6309\u5b57\u8282\u5bfb\u5740\uff0c\u903b\u8f91\u5730\u5740\u7ed3\u6784\u4e2d\uff0c\u9875\u5185\u504f\u79fb\u91cf\u536010\u4f4d(\u8bf4\u660e\u4e00\u4e2a\u9875\u9762\u7684\u5927\u5c0f\u4e3a2^10 B=1KB)<\/strong>\uff0c\u9875\u53f72\u5bf9\u5e94\u7684\u5185\u5b58\u5757\u53f7b=8\uff0c\u5c06\u903b\u8f91\u5730\u5740A=2500\u8f6c\u6362\u4e3a\u7269\u7406\u5730\u5740E\u3002
\u2460\u8ba1\u7b97\u9875\u53f7\u3001\u9875\u5185\u504f\u79fb\u91cf
\u9875\u53f7P=A\/L<\/strong>=2500\/1024=2\uff1b\u9875\u5185\u504f\u79fb\u91cfW<\/strong>=A%L=2500%1024=452
\u2461\u6839\u636e\u9898\u4e2d\u6761\u4ef6\u53ef\u77e5\uff0c\u9875\u53f72\u6ca1\u6709\u8d8a\u754c\uff0c\u5176\u5b58\u653e\u7684\u5185\u5b58\u5757\u53f7b=8\uff08\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u6b65\u9aa4\uff09
\u2462\u7269\u7406\u5730\u5740E=b*L+W=8*1024+452=8644<\/strong>\u5728\u5206\u9875\u5b58\u50a8\u7ba1\u7406\uff08\u9875\u5f0f\u7ba1\u7406\uff09\u7684\u7cfb\u7edf\u4e2d\uff0c\u53ea\u8981\u786e\u5b9a\u4e86\u6bcf\u4e2a\u9875\u9762\u7684\u5927\u5c0f\uff0c\u903b\u8f91\u5730\u5740\u7ed3\u6784\u5c31\u786e\u5b9a\u4e86\u3002\u56e0\u6b64\uff0c\u9875\u5f0f\u7ba1\u7406\u4e2d\u5730\u5740\u662f\u4e00\u7ef4\u7684\u3002\u5373\uff0c\u53ea\u8981\u7ed9\u51fa\u4e00\u4e2a\u903b\u8f91\u5730\u5740\uff0c\u7cfb\u7edf\u5c31\u53ef\u4ee5\u81ea\u52a8\u5730\u7b97\u51fa\u9875\u53f7\u3001\u9875\u5185\u504f\u79fb\u91cf\u4e24\u4e2a\u90e8\u5206\uff0c\u5e76\u4e0d\u9700\u8981\u663e\u5f0f\u5730\u544a\u8bc9\u7cfb\u7edf\u8fd9\u4e2a\u903b\u8f91\u5730\u5740\u4e2d\uff0c\u9875\u5185\u504f\u79fb\u91cf\u5360\u591a\u5c11\u4f4d\u3002<\/p>\n
\u738b\u9053\u8ba1\u7b97\u673a\u8003\u7814 \u64cd\u4f5c\u7cfb\u7edf_\u54d4\u54e9\u54d4\u54e9_bilibili<\/p>\n
\n 7.2\u5185\u5b58\u8bbf\u95ee\u65f6\u95f4\u7684\u6982\u5ff5 <\/h4>\n
\n\u516b\u3001\u5916\u90e8\u8bbe\u5907\u7f13\u51b2\u533a\u7684\u539f\u7406\u548c\u8ba1\u7b97<\/strong><\/h2>\n
8.1\u5f15\u5165\u7f13\u51b2\u533a\u7684\u539f\u56e0\uff1a<\/h4>\n
\n 8.2\u5355\u7f13\u51b2<\/h4>\n