{"id":65651,"date":"2026-01-25T14:32:48","date_gmt":"2026-01-25T06:32:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/65651.html"},"modified":"2026-01-25T14:32:48","modified_gmt":"2026-01-25T06:32:48","slug":"%e3%80%90%e7%ba%bf%e7%a8%8b%e5%90%8c%e6%ad%a5%e3%80%91%e4%bf%a1%e5%8f%b7%e9%87%8f%e4%b8%8e%e7%8e%af%e5%bd%a2%e9%98%9f%e5%88%97%e7%9a%84%e7%94%9f%e4%ba%a7%e6%b6%88%e8%b4%b9%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/65651.html","title":{"rendered":"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b"},"content":{"rendered":"<h2>\u524d\u8a00<\/h2>\n<p>\u672c\u7bc7\u6587\u7ae0\u6211\u4eec\u6765\u63a2\u8ba8\u4fe1\u53f7\u91cf\u7684\u6982\u5ff5&#xff0c;\u6211\u4f1a\u5148\u4ece\u4fe1\u53f7\u91cf\u662f\u4ec0\u4e48\u6765\u4ecb\u7ecd\u4fe1\u53f7\u91cf&#xff0c;\u7136\u540e\u4ece\u4e3a\u4ec0\u4e48\u4f1a\u4ea7\u751f\u4fe1\u53f7\u91cf\u8fd9\u4e2a\u6982\u5ff5\u6765\u5e26\u5927\u5bb6\u4e00\u8d77\u7406\u89e3\u4fe1\u53f7\u91cf&#xff0c;\u6700\u540e\u6211\u4f1a\u901a\u8fc7\u4e00\u4e2a\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5e26\u5927\u5bb6\u6765\u5b66\u4e60\u4fe1\u53f7\u91cf\u662f\u5982\u4f55\u4f7f\u7528\u7684\u3001<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u672c\u7bc7\u6587\u7ae0\u5199\u7684\u4e0d\u9519\u7684\u8bdd&#xff0c;\u5e0c\u671b\u7559\u4e0b\u5b9d\u8d35\u7684\u70b9\u8d5e(\u8fd9\u4e2a\u5bf9\u6211\u975e\u5e38\u975e\u5e38\u975e\u5e38\u91cd\u8981)\u3001\u5173\u6ce8\u52a0\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u662f\u6211\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b&#xff01;&#xff01;&#xff01;&#xff01;<\/p>\n<h2>\u4fe1\u53f7\u91cf<\/h2>\n<h3>\u6982\u5ff5\u7406\u89e3<\/h3>\n<p>\u4ec0\u4e48\u662f\u4fe1\u53f7\u91cf\u5462&#xff1f;\u524d\u9762\u6211\u4eec\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u91cc\u9762&#xff0c;\u6211\u4eec\u662f\u628a\u8d44\u6e90\u6574\u4f53\u8fdb\u884c\u4f7f\u7528&#xff0c;\u7136\u540e\u901a\u8fc7\u4fe1\u53f7\u91cf\u53bb\u63a7\u5236&#xff0c;\u6bcf\u4e00\u6b21\u53ea\u8ba9\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u5165\u4e34\u754c\u533a\u8fdb\u884c\u8bbf\u95ee&#xff0c;\u89e3\u51b3\u7ebf\u7a0b\u9965\u997f\u7684\u95ee\u9898&#xff1b;\u9664\u4e86\u8fd9\u4e2a\u65b9\u6cd5&#xff0c;\u6211\u4eec\u8fd8\u6709\u6ca1\u6709\u5176\u4ed6\u7684\u89e3\u51b3\u65b9\u6cd5\u5462&#xff1f;<\/p>\n<p>\u5982\u679c\u6211\u4eec\u628a\u4e00\u4e2a\u5171\u4eab\u8d44\u6e90\u5206\u6210\u8bb8\u591a\u4efd&#xff0c;\u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u90fd\u53bb\u8bbf\u95ee\u5176\u4e2d\u7684\u4e00\u4efd&#xff0c;\u8fd9\u6837\u6211\u4eec\u4e0d\u5c31\u53ef\u4ee5\u8ba9\u591a\u7ebf\u7a0b\u5e76\u53d1\u8bbf\u95ee\u4e00\u4e2a\u516c\u5171\u7684\u8d44\u6e90\u4e86<\/p>\n<p>\u5982\u679c\u6211\u4eec\u5bf9\u5171\u4eab\u8d44\u6e90\u8fdb\u884c\u6574\u4f53\u4f7f\u7528&#xff0c;\u90a3\u4e48\u5c31\u9700\u8981\u6709\u4e92\u65a5\u9501&#xff0c;\u4e3a\u4e86\u9632\u6b62\u7ebf\u7a0b\u9965\u997f&#xff0c;\u6240\u4ee5\u5c31\u9700\u8981\u6709\u4fe1\u53f7\u91cf&#xff1b;\u5982\u679c\u6211\u4eec\u5bf9\u5171\u4eab\u8d44\u6e90\u8fdb\u884c\u5c40\u90e8\u4f7f\u7528&#xff0c;\u6211\u4eec\u5c31\u9700\u8981\u63a7\u5236\u8fdb\u5165\u5171\u4eab\u8d44\u6e90\u7684\u7ebf\u7a0b\u6570\u91cf<\/p>\n<p>\u90a3\u4e48&#xff0c;\u5bf9\u4e8e\u5c40\u90e8\u8bbf\u95ee\u7684\u8bdd&#xff0c;\u6211\u4eec\u5c31\u9700\u8981\u89e3\u51b3\u4ee5\u4e0b\u51e0\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u8fdb\u5165\u5171\u4eab\u8d44\u6e90\u7684\u7ebf\u7a0b\u6570\u91cf\u8d85\u8fc7\u8d44\u6e90\u5757\u7684\u6570\u91cf<\/li>\n<li>\u4e0d\u540c\u7684\u7ebf\u7a0b\u8bbf\u95ee\u4e86\u540c\u4e00\u4e2a\u4f4d\u7f6e<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u89e3\u51b3\u4e0a\u9762\u7684\u95ee\u9898&#xff0c;\u6211\u4eec\u5f15\u5165\u4e86\u4fe1\u53f7\u91cf&#xff0c;\u5176\u672c\u8d28\u662f\u4e00\u4e2a\u8ba1\u6570\u5668&#xff0c;\u4e3a\u4e86\u63cf\u8ff0\u4e34\u754c\u8d44\u6e90\u7684\u6570\u91cf&#xff0c;\u672a\u6765\u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u5165\u4e34\u754c\u8d44\u6e90\u65f6&#xff0c;\u7533\u8bf7\u8d44\u6e90&#xff0c;\u8ba1\u6570\u5668\u9700\u8981\u2013&#xff0c;\u6211\u4eec\u79f0\u4e4b\u4e3aP\u64cd\u4f5c&#xff1b;\u7ebf\u7a0b\u51fa\u4e34\u754c\u8d44\u6e90\u65f6&#xff0c;\u91ca\u653e\u8d44\u6e90&#xff0c;\u8ba1\u6570\u5668\u9700\u8981&#043;&#043;&#xff0c;\u6211\u4eec\u79f0\u4e4b\u4e3aV\u64cd\u4f5c&#xff1b;\u5f53\u8ba1\u6570\u5668\u5c0f\u4e8e\u7b49\u4e8e0\u65f6&#xff0c;\u6ca1\u6709\u8d44\u6e90&#xff0c;\u5c31\u4e0d\u5141\u8bb8\u7ebf\u7a0b\u8fdb\u5165\u3002\u6240\u4ee5\u7533\u8bf7\u4fe1\u53f7\u91cf&#xff0c;\u672c\u8d28\u662f\u5bf9\u5171\u4eab\u8d44\u6e90\u7684\u9884\u5b9a\u673a\u5236<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u4f1a\u53d1\u73b0&#xff0c;\u7ebf\u7a0b\u7533\u8bf7\u548c\u91ca\u653e\u4fe1\u53f7\u91cf\u524d\u63d0\u662f\u9700\u8981\u770b\u5230\u540c\u4e00\u4efd\u4fe1\u53f7\u91cf&#xff0c;\u4e3a\u4e86\u8ba9\u7ebf\u7a0b\u770b\u5230\u540c\u4e00\u4efd\u4fe1\u53f7\u91cf&#xff0c;\u90a3\u4e48\u8fd9\u4e2a\u4fe1\u53f7\u91cf\u672c\u8eab\u5c31\u662f\u4e00\u4efd\u5171\u4eab\u8d44\u6e90&#xff0c;\u90a3\u4e48\u6211\u4eec\u5982\u4f55\u4fdd\u8bc1\u4fe1\u53f7\u91cf\u7684\u5b89\u5168\u5462&#xff1f;<\/p>\n<p>\u7b54\u6848\u662f&#xff1a;\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u7533\u8bf7\/\u91ca\u653e\u4fe1\u53f7\u91cf\u7684PV\u64cd\u4f5c\u65f6\u539f\u5b50\u7684<\/p>\n<h3>\u4fe1\u53f7\u91cf\u63a5\u53e3<\/h3>\n<h4>\u521b\u5efa\/\u521d\u59cb\u5316\u4fe1\u53f7\u91cf<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90f5eaee.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<ul>\n<li>\u4fe1\u53f7\u91cf\u7c7b\u578b&#xff1a;sem_t<\/li>\n<li>pshard&#xff1a;\u8868\u660e\u8be5\u4fe1\u53f7\u91cf\u662f\u8fdb\u7a0b\u95f4\u4f7f\u7528\u8fd8\u662f\u7ebf\u7a0b\u95f4\u4f7f\u7528&#xff0c;\u4f20\u51650\u8868\u793a\u7ebf\u7a0b\u95f4\u4f7f\u7528<\/li>\n<li>int value&#xff1a;\u4fe1\u53f7\u91cf\u8ba1\u6570\u5668\u521d\u59cb\u503c<\/li>\n<li>\u8fd4\u56de\u503c&#xff1a;\u6210\u529f\u8fd4\u56de0&#xff0c;\u5931\u8d25\u8fd4\u56de-1<\/li>\n<\/ul>\n<h4>\u4fe1\u53f7\u91cf\u9500\u6bc1<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90f7e8e3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u7533\u8bf7\u4fe1\u53f7\u91cf\/P\u64cd\u4f5c<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90f8f3e8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u91ca\u653e\u4fe1\u53f7\u91cf\/V\u64cd\u4f5c<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90faf7bb.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u4f7f\u7528\u65b9\u6cd5<\/h4>\n<p>\u90a3\u4e48\u5bf9\u4e8e\u591a\u7ebf\u7a0b\u4e4b\u95f4&#xff0c;\u6211\u4eec\u60f3\u4f7f\u7528\u4fe1\u53f7\u91cf&#xff0c;\u6211\u4eec\u5c31\u9700\u8981\u5b9a\u4e49\u4e00\u4e2a\u5168\u5c40\u7684\u4fe1\u53f7\u91cf&#xff0c;\u7ebf\u7a0b\u8fdb\u5165\u5171\u4eab\u8d44\u6e90\u7684\u65f6\u5019\u8fdb\u884cP\u64cd\u4f5c&#xff0c;\u7533\u8bf7\u4fe1\u53f7\u91cf&#xff0c;\u4fe1\u53f7\u91cf\u2013&#xff1b;\u79bb\u5f00\u5171\u4eab\u8d44\u6e90\u7684\u65f6\u5019\u8fdb\u884cV\u64cd\u4f5c&#xff0c;\u91ca\u653e\u4fe1\u53f7\u91cf&#xff0c;\u4fe1\u53f7\u91cf&#043;&#043;<\/p>\n<p>\u90a3\u4e48\u5bf9\u4e8e\u591a\u8fdb\u7a0b\u4e4b\u95f4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5171\u4eab\u5185\u5b58&#xff0c;\u4f7f\u7528\u4e00\u4e2a\u6307\u9488\u6307\u5411\u5171\u4eab\u5185\u5b58\u5f00\u5934\u7684\u4f4d\u7f6e&#xff0c;\u5c06\u6307\u9488\u5f3a\u8f6c\u6210\u4fe1\u53f7\u91cf\u7c7b\u578b&#xff0c;\u521d\u59cb\u5316\u4fe1\u53f7\u91cf&#xff0c;\u4f7f\u7528\u5b8c\u6bd5\u9500\u6bc1\u4fe1\u53f7\u91cf<\/p>\n<h3>\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u6a21\u578b<\/h3>\n<p>\u6211\u4eec\u53ef\u4ee5\u628a\u73af\u5f62\u961f\u5217\u62bd\u8c61\u6210\u7ebf\u6027\u7684\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u5b9a\u4e49\u4e24\u4e2a\u6307\u9488&#xff0c;\u5206\u522b\u6307\u5411\u6570\u7ec4\u7684\u5934\u548c\u5c3e&#xff0c;\u5f53\u5c3e\u90e8\u6307\u9488\u8d70\u5230\u6570\u7ec4\u7684\u5c3e\u90e8\u7684\u65f6\u5019&#xff0c;\u91cd\u65b0\u4ece\u5f00\u5934\u7ee7\u7eed\u5411\u540e&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u6570\u7ec4\u6a21\u62df\u4e00\u4e2a\u73af\u5f62\u961f\u5217&#xff0c;\u4ece\u800c\u5728\u903b\u8f91\u4e0a\u53d8\u6210\u4e00\u4e2a\u73af\u5f62\u961f\u5217&#xff0c;\u5f53\u9996\u5c3e\u6307\u9488\u76f8\u9047\u7684\u65f6\u5019&#xff0c;\u4e00\u5b9a\u4e3a\u7a7a\u6216\u4e3a\u6ee1&#xff0c;\u5982\u679c\u4e0d\u76f8\u7b49&#xff0c;\u90a3\u4e48\u4e00\u5b9a\u8bbf\u95ee\u7684\u4e0d\u662f\u540c\u4e00\u4e2a\u4f4d\u7f6e&#xff1b;\u4e3a\u4e86\u5224\u65ad\u73af\u5f62\u961f\u5217\u662f\u7a7a\u8fd8\u662f\u6ee1&#xff0c;\u6211\u4eec\u53ef\u4ee5\u8ba9\u6570\u7ec4\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u59cb\u7ec8\u4e3a\u7a7a&#xff0c;\u7136\u540e\u53bb\u5224\u65ad\u5c3e\u6307\u9488\u7684\u4e0b\u4e00\u4e2a\u4f4d\u7f6e\u662f\u5426\u4e3a\u5934&#xff0c;\u5982\u679c\u6307\u5411\u5934&#xff0c;\u8bf4\u660e\u6b64\u65f6\u73af\u5f62\u961f\u5217\u5df2\u7ecf\u6ee1\u4e86&#xff0c;\u90a3\u4e48\u6211\u4eec\u5c31\u4e0d\u518d\u63d2\u5165\u5143\u7d20<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u8be5\u5982\u4f55\u53bb\u5b9e\u73b0\u4e00\u4e2a\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u6a21\u578b\u5462&#xff1f;<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u628a\u5934\u90e8\u6307\u9488\u4f5c\u4e3a\u4e00\u4e2a\u6d88\u8d39\u8005&#xff0c;\u628a\u5c3e\u90e8\u6307\u9488\u4f5c\u4e3a\u4e00\u4e2a\u751f\u4ea7\u8005&#xff0c;\u4e3a\u7a7a\u7684\u65f6\u5019&#xff0c;\u5fc5\u987b\u8ba9\u751f\u4ea7\u8005\u5148\u8fd0\u884c&#xff0c;\u6b64\u65f6\u6211\u4eec\u5c31\u4fdd\u8bc1\u4e86\u751f\u4ea7\u4e0e\u6d88\u8d39\u7684\u4e92\u65a5\u4e0e\u540c\u6b65\u5173\u7cfb&#xff1b;\u4e3a\u6ee1\u7684\u65f6\u5019&#xff0c;\u751f\u4ea7\u548c\u6d88\u8d39\u53c8\u6307\u5411\u540c\u4e00\u4e2a\u4f4d\u7f6e\u4e86&#xff0c;\u5fc5\u987b\u8ba9\u6d88\u8d39\u8005\u5148\u8fd0\u884c&#xff0c;\u6b64\u65f6\u6211\u4eec\u53c8\u4fdd\u8bc1\u4e86\u751f\u4ea7\u4e0e\u6d88\u8d39\u7684\u4e92\u65a5\u4e0e\u540c\u6b65\u5173\u7cfb&#xff1b;\u4e0d\u4e3a\u7a7a\u548c\u4e0d\u4e3a\u6ee1\u65f6&#xff0c;\u6211\u4eec\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u751f\u4ea7\u548c\u6d88\u8d39\u4e0d\u5c5e\u4e8e\u540c\u4e00\u4e2a\u4f4d\u7f6e&#xff0c;\u6b64\u65f6\u5c31\u53ef\u4ee5\u5e76\u53d1\u8fd0\u884c<\/p>\n<p>\u7efc\u4e0a\u6240\u8ff0&#xff1a;<\/p>\n<ul>\n<li>\u4e3a\u7a7a\u7684\u65f6\u5019&#xff0c;\u5fc5\u987b\u8ba9\u751f\u4ea7\u8005\u5148\u8fd0\u884c&#xff0c;\u56e0\u4e3a\u6d88\u8d39\u8005\u4e0d\u80fd\u8d85\u8fc7\u751f\u4ea7\u8005<\/li>\n<li>\u4e3a\u6ee1\u7684\u65f6\u5019&#xff0c;\u5fc5\u987b\u8ba9\u6d88\u8d39\u8005\u5148\u8fd0\u884c&#xff0c;\u56e0\u4e3a\u751f\u4ea7\u8005\u4e0d\u80fd\u5957\u5708\u6d88\u8d39\u8005<\/li>\n<li>\u4e0d\u4e3a\u7a7a\u4e0d\u4e3a\u6ee1&#xff0c;\u5e76\u53d1\u8fd0\u884c<\/li>\n<\/ul>\n<p>\u90a3\u4e48\u5728\u8fd9\u4e2a\u6a21\u578b\u91cc\u9762&#xff0c;\u751f\u4ea7\u8005\u6700\u5173\u5fc3\u7684\u662f\u7a7a\u4f59\u7a7a\u95f4\u7684\u6570\u91cf&#xff1b;\u6d88\u8d39\u8005\u6700\u5173\u5fc3\u7684\u662f\u6570\u636e\u8d44\u6e90\u7684\u6570\u91cf&#xff1b;\u751f\u4ea7\u8005\u8fdb\u884cP\u64cd\u4f5c\u5c31\u662f\u7533\u8bf7\u7a7a\u95f4\u8d44\u6e90&#xff0c;V\u64cd\u4f5c\u5c31\u662f\u5f52\u8fd8\u6570\u636e\u8d44\u6e90&#xff1b;\u6d88\u8d39\u8005\u8fdb\u884cP\u64cd\u4f5c\u5c31\u662f\u7533\u8bf7\u6570\u636e\u8d44\u6e90&#xff0c;V\u64cd\u4f5c\u5c31\u662f\u5f52\u8fd8\u7a7a\u95f4\u8d44\u6e90<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u6839\u636e\u4e0a\u9762\u7684\u601d\u8def&#xff0c;\u5c31\u53ef\u4ee5\u5199\u4e0b\u5982\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p>RingQueue.hpp<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">pragma<\/span> <span class=\"token expression\">once<\/span><\/span><\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;iostream&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;vector&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&#034;Sem.hpp&#034;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">const<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> gcap<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">template<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">typename<\/span> <span class=\"token class-name\">T<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token keyword\">class<\/span> <span class=\"token class-name\">RingQueue<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">public<\/span><span class=\"token operator\">:<\/span><br \/>\n    <span class=\"token function\">RingQueue<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> cap<span class=\"token operator\">&#061;<\/span>gcap<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token operator\">:<\/span><span class=\"token function\">_cap<\/span><span class=\"token punctuation\">(<\/span>cap<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token function\">_ringqueue<\/span><span class=\"token punctuation\">(<\/span>cap<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token function\">_space_sem<\/span><span class=\"token punctuation\">(<\/span>cap<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">_data_sem<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token function\">_p_step<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">_c_step<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">void<\/span> <span class=\"token function\">Pop<\/span><span class=\"token punctuation\">(<\/span>T<span class=\"token operator\">*<\/span>out<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        _data_sem<span class=\"token punctuation\">.<\/span><span class=\"token function\">P<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token operator\">*<\/span>out<span class=\"token operator\">&#061;<\/span>_ringqueue<span class=\"token punctuation\">[<\/span>_c_step<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        _c_step<span class=\"token operator\">%&#061;<\/span>_cap<span class=\"token punctuation\">;<\/span><br \/>\n        _space_sem<span class=\"token punctuation\">.<\/span><span class=\"token function\">V<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">void<\/span> <span class=\"token function\">EnQueue<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> T<span class=\"token operator\">&amp;<\/span>in<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        _space_sem<span class=\"token punctuation\">.<\/span><span class=\"token function\">P<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/\u751f\u4ea7\u6570\u636e<\/span><br \/>\n        _ringqueue<span class=\"token punctuation\">[<\/span>_p_step<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&#061;<\/span>in<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/\u5224\u65ad\u662f\u5426\u8d8a\u754c<\/span><br \/>\n        _p_step<span class=\"token operator\">%&#061;<\/span>_cap<span class=\"token punctuation\">;<\/span><br \/>\n        _data_sem<span class=\"token punctuation\">.<\/span><span class=\"token function\">V<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token operator\">~<\/span><span class=\"token function\">RingQueue<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token keyword\">private<\/span><span class=\"token operator\">:<\/span><br \/>\n    std<span class=\"token double-colon punctuation\">::<\/span>vector<span class=\"token operator\">&lt;<\/span>T<span class=\"token operator\">&gt;<\/span> _ringqueue<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/\u4e34\u754c\u8d44\u6e90<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> _cap<span class=\"token punctuation\">;<\/span><\/p>\n<p>    Sem _space_sem<span class=\"token punctuation\">;<\/span><br \/>\n    Sem _data_sem<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/\u751f\u4ea7\u548c\u6d88\u8d39\u7684\u4f4d\u7f6e<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> _p_step<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> _c_step<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>Sem.hpp<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">pragma<\/span> <span class=\"token expression\">once<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;iostream&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;semaphore.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Sem<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">public<\/span><span class=\"token operator\">:<\/span><br \/>\n    <span class=\"token function\">Sem<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> num<span class=\"token punctuation\">)<\/span><span class=\"token operator\">:<\/span><span class=\"token function\">_num<\/span><span class=\"token punctuation\">(<\/span>num<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">sem_init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>_sem<span class=\"token punctuation\">,<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span>_num<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">void<\/span> <span class=\"token function\">P<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> n<span class=\"token operator\">&#061;<\/span><span class=\"token function\">sem_wait<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>_sem<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span>n<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">void<\/span> <span class=\"token function\">V<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> n <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">sem_post<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>_sem<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span>n<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token operator\">~<\/span><span class=\"token function\">Sem<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">sem_destroy<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>_sem<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token keyword\">private<\/span><span class=\"token operator\">:<\/span><br \/>\n    sem_t _sem<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> _num<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>main.cc<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&#034;RingQueue.hpp&#034;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;pthread.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span><span class=\"token string\">&lt;unistd.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span><span class=\"token function\">consumer<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span>args<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    RingQueue<span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">*<\/span>rq<span class=\"token operator\">&#061;<\/span><span class=\"token generic-function\"><span class=\"token function\">static_cast<\/span><span class=\"token generic class-name\"><span class=\"token operator\">&lt;<\/span>RingQueue<span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">*<\/span><span class=\"token operator\">&gt;<\/span><\/span><\/span><span class=\"token punctuation\">(<\/span>args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span><span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">sleep<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> data<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        rq<span class=\"token operator\">-&gt;<\/span><span class=\"token function\">Pop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        std<span class=\"token double-colon punctuation\">::<\/span>cout<span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#034;\u6d88\u8d39\u4e86\u4e00\u4e2a\u6570\u636e&#xff1a;&#034;<\/span><span class=\"token operator\">&lt;&lt;<\/span>data<span class=\"token operator\">&lt;&lt;<\/span>std<span class=\"token double-colon punctuation\">::<\/span>endl<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span><span class=\"token function\">productor<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span>args<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    RingQueue<span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">*<\/span>rq<span class=\"token operator\">&#061;<\/span><span class=\"token generic-function\"><span class=\"token function\">static_cast<\/span><span class=\"token generic class-name\"><span class=\"token operator\">&lt;<\/span>RingQueue<span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">*<\/span><span class=\"token operator\">&gt;<\/span><\/span><\/span><span class=\"token punctuation\">(<\/span>args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> data<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span><span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        rq<span class=\"token operator\">-&gt;<\/span><span class=\"token function\">EnQueue<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        std<span class=\"token double-colon punctuation\">::<\/span>cout<span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#034;\u751f\u4ea7\u4e86\u4e00\u4e2a\u6570\u636e&#xff1a;&#034;<\/span><span class=\"token operator\">&lt;&lt;<\/span>data<span class=\"token operator\">&lt;&lt;<\/span>std<span class=\"token double-colon punctuation\">::<\/span>endl<span class=\"token punctuation\">;<\/span><br \/>\n        data<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    RingQueue<span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">*<\/span>rq<span class=\"token operator\">&#061;<\/span><span class=\"token keyword\">new<\/span> <span class=\"token generic-function\"><span class=\"token function\">RingQueue<\/span><span class=\"token generic class-name\"><span class=\"token operator\">&lt;<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">&gt;<\/span><\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    pthread_t c<span class=\"token punctuation\">,<\/span>p<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token function\">pthread_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>c<span class=\"token punctuation\">,<\/span><span class=\"token keyword\">nullptr<\/span><span class=\"token punctuation\">,<\/span>consumer<span class=\"token punctuation\">,<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span>rq<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">pthread_create<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>p<span class=\"token punctuation\">,<\/span><span class=\"token keyword\">nullptr<\/span><span class=\"token punctuation\">,<\/span>productor<span class=\"token punctuation\">,<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span>rq<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token function\">pthread_join<\/span><span class=\"token punctuation\">(<\/span>c<span class=\"token punctuation\">,<\/span><span class=\"token keyword\">nullptr<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">pthread_join<\/span><span class=\"token punctuation\">(<\/span>p<span class=\"token punctuation\">,<\/span><span class=\"token keyword\">nullptr<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u95ee\u9898\u5206\u6790<\/h3>\n<ul>\n<li>\n<p>\u6211\u4eec\u770b\u4e0a\u9762\u7684\u4ee3\u7801&#xff0c;\u5bf9\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u800c\u8a00&#xff0c;\u6211\u4eec\u5e76\u6ca1\u6709\u52a0\u9501&#xff0c;\u90a3\u4e48\u80fd\u5426\u4fdd\u8bc1\u6570\u636e\u7684\u5b89\u5168\u5462&#xff1f;<\/p>\n<p>\u6211\u4eec\u901a\u8fc7\u4fe1\u53f7\u91cf&#xff0c;\u53d8\u76f8\u7684\u5b8c\u6210\u4e86\u4e3a\u7a7a\u548c\u4e3a\u6ee1\u7684\u540c\u6b65\u548c\u4e92\u65a5\u52a8\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u6211\u4eec\u53d1\u73b0&#xff0c;\u5728PV\u64cd\u4f5c\u4e4b\u95f4\u7684\u4e34\u754c\u533a\u5185\u90e8&#xff0c;\u6211\u4eec\u6ca1\u6709\u5224\u65ad\u8d44\u6e90\u662f\u5426\u5c31\u7eea&#xff0c;\u5c31\u76f4\u63a5\u8fdb\u884c\u64cd\u4f5c&#xff0c;\u8fd9\u6837\u505a\u6b63\u786e\u5417&#xff1f;<\/p>\n<p>\u7b54\u6848\u5728\u4e8e\u6211\u4eec\u7533\u8bf7\u4fe1\u53f7\u91cf\u5b9e\u9645\u4e0a\u662f\u5bf9\u8d44\u6e90\u7684\u9884\u5b9a\u673a\u5236&#xff0c;\u6240\u4ee5\u5728\u8fdb\u884cP\u64cd\u4f5c\u65f6&#xff0c;\u672c\u8d28\u5c31\u662f\u5bf9\u8d44\u6e90\u662f\u5426\u5c31\u7eea\u505a\u5224\u65ad&#xff0c;\u6211\u4eec\u5c06\u5224\u65ad\u4ece\u4e34\u754c\u533a\u5185\u90e8\u8f6c\u79fb\u5230\u4e86\u4e34\u754c\u533a\u5916\u90e8\u6216\u5165\u53e3\u5904<\/p>\n<\/li>\n<li>\n<p>\u6211\u4eec\u8bbf\u95ee\u8d44\u6e90\u53ef\u4ee5\u4f7f\u7528\u6574\u4f53\u8bbf\u95ee\u548c\u5c40\u90e8\u8bbf\u95ee&#xff0c;\u5982\u679c\u6211\u4eec\u628a\u4fe1\u53f7\u91cf\u521d\u59cb\u503c\u8bbe\u7f6e\u4e3a1&#xff0c;\u90a3\u4e48\u6211\u4eec\u8be5\u600e\u4e48\u533a\u7406\u89e3\u5462&#xff1f;<\/p>\n<p>\u5b9e\u9645\u4e0a&#xff0c;\u4e8c\u5143\u4fe1\u53f7\u91cf\u5c31\u662f\u9501&#xff01;&#xff01;&#xff01;\u9501\u7684\u672c\u8d28\u662f\u4e92\u65a5\u7684\u7533\u8bf7\u8d44\u6e90&#xff0c;\u7533\u8bf7\u9501\u4e0d\u5c31\u662fP\u64cd\u4f5c&#xff0c;\u91ca\u653e\u9501\u4e0d\u5c31\u662fV\u64cd\u4f5c\u5417&#xff0c;\u6700\u7ec8\u6211\u4eec\u53ef\u4ee5\u77e5\u9053&#xff0c;\u9501\u5c31\u662f\u4fe1\u53f7\u91cf\u7684\u4e00\u79cd\u7279\u6b8a\u60c5\u51b5<\/p>\n<\/li>\n<li>\n<p>\u90a3\u4e48\u6211\u4eec\u53d8\u6210\u591a\u751f\u4ea7\u591a\u6d88\u8d39&#xff0c;\u6211\u4eec\u5e94\u8be5\u600e\u4e48\u505a&#xff1f;<\/p>\n<p>\u7b54\u6848\u662f&#xff0c;\u6211\u4eec\u5982\u679c\u60f3\u8981\u53d8\u6210\u591a\u751f\u4ea7\u591a\u6d88\u8d39&#xff0c;\u90a3\u4e48\u6211\u4eec\u5c31\u5fc5\u987b\u5bf9\u751f\u4ea7\u8005\u4e4b\u95f4\u8fdb\u884c\u52a0\u9501&#xff0c;\u5bf9\u6d88\u8d39\u8005\u4e4b\u95f4\u8fdb\u884c\u52a0\u9501&#xff0c;\u7ef4\u62a4\u540c\u6b65\u4e0e\u4e92\u65a5\u5173\u7cfb<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00<br \/>\n\u672c\u7bc7\u6587\u7ae0\u6211\u4eec\u6765\u63a2\u8ba8\u4fe1\u53f7\u91cf\u7684\u6982\u5ff5&#xff0c;\u6211\u4f1a\u5148\u4ece\u4fe1\u53f7\u91cf\u662f\u4ec0\u4e48\u6765\u4ecb\u7ecd\u4fe1\u53f7\u91cf&#xff0c;\u7136\u540e\u4ece\u4e3a\u4ec0\u4e48\u4f1a\u4ea7\u751f\u4fe1\u53f7\u91cf\u8fd9\u4e2a\u6982\u5ff5\u6765\u5e26\u5927\u5bb6\u4e00\u8d77\u7406\u89e3\u4fe1\u53f7\u91cf&#xff0c;\u6700\u540e\u6211\u4f1a\u901a\u8fc7\u4e00\u4e2a\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5e26\u5927\u5bb6\u6765\u5b66\u4e60\u4fe1\u53f7\u91cf\u662f\u5982\u4f55\u4f7f\u7528\u7684\u3001<br \/>\n\u5982\u679c\u89c9\u5f97\u672c\u7bc7\u6587\u7ae0\u5199\u7684\u4e0d\u9519\u7684\u8bdd&#xff0c;\u5e0c\u671b\u7559\u4e0b\u5b9d\u8d35\u7684\u70b9\u8d5e(\u8fd9\u4e2a\u5bf9\u6211\u975e\u5e38\u975e\u5e38\u975e\u5e38\u91cd\u8981)\u3001\u5173\u6ce8\u52a0\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u662f\u6211\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b&#xff01;&#xff01;&#xff01;&#xff01;<br \/>\n\u4fe1\u53f7\u91cf<br \/>\n\u6982\u5ff5<\/p>\n","protected":false},"author":2,"featured_media":65647,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,58,103,149],"topic":[],"class_list":["post-65651","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-centos","tag-linux","tag-ubuntu","tag-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/65651.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00 \u672c\u7bc7\u6587\u7ae0\u6211\u4eec\u6765\u63a2\u8ba8\u4fe1\u53f7\u91cf\u7684\u6982\u5ff5&#xff0c;\u6211\u4f1a\u5148\u4ece\u4fe1\u53f7\u91cf\u662f\u4ec0\u4e48\u6765\u4ecb\u7ecd\u4fe1\u53f7\u91cf&#xff0c;\u7136\u540e\u4ece\u4e3a\u4ec0\u4e48\u4f1a\u4ea7\u751f\u4fe1\u53f7\u91cf\u8fd9\u4e2a\u6982\u5ff5\u6765\u5e26\u5927\u5bb6\u4e00\u8d77\u7406\u89e3\u4fe1\u53f7\u91cf&#xff0c;\u6700\u540e\u6211\u4f1a\u901a\u8fc7\u4e00\u4e2a\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5e26\u5927\u5bb6\u6765\u5b66\u4e60\u4fe1\u53f7\u91cf\u662f\u5982\u4f55\u4f7f\u7528\u7684\u3001 \u5982\u679c\u89c9\u5f97\u672c\u7bc7\u6587\u7ae0\u5199\u7684\u4e0d\u9519\u7684\u8bdd&#xff0c;\u5e0c\u671b\u7559\u4e0b\u5b9d\u8d35\u7684\u70b9\u8d5e(\u8fd9\u4e2a\u5bf9\u6211\u975e\u5e38\u975e\u5e38\u975e\u5e38\u91cd\u8981)\u3001\u5173\u6ce8\u52a0\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u662f\u6211\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b&#xff01;&#xff01;&#xff01;&#xff01; \u4fe1\u53f7\u91cf \u6982\u5ff5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/65651.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-25T06:32:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90f5eaee.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65651.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/65651.html\",\"name\":\"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-25T06:32:48+00:00\",\"dateModified\":\"2026-01-25T06:32:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/65651.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/65651.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65651.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/65651.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00 \u672c\u7bc7\u6587\u7ae0\u6211\u4eec\u6765\u63a2\u8ba8\u4fe1\u53f7\u91cf\u7684\u6982\u5ff5&#xff0c;\u6211\u4f1a\u5148\u4ece\u4fe1\u53f7\u91cf\u662f\u4ec0\u4e48\u6765\u4ecb\u7ecd\u4fe1\u53f7\u91cf&#xff0c;\u7136\u540e\u4ece\u4e3a\u4ec0\u4e48\u4f1a\u4ea7\u751f\u4fe1\u53f7\u91cf\u8fd9\u4e2a\u6982\u5ff5\u6765\u5e26\u5927\u5bb6\u4e00\u8d77\u7406\u89e3\u4fe1\u53f7\u91cf&#xff0c;\u6700\u540e\u6211\u4f1a\u901a\u8fc7\u4e00\u4e2a\u57fa\u4e8e\u4fe1\u53f7\u91cf\u7684\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5e26\u5927\u5bb6\u6765\u5b66\u4e60\u4fe1\u53f7\u91cf\u662f\u5982\u4f55\u4f7f\u7528\u7684\u3001 \u5982\u679c\u89c9\u5f97\u672c\u7bc7\u6587\u7ae0\u5199\u7684\u4e0d\u9519\u7684\u8bdd&#xff0c;\u5e0c\u671b\u7559\u4e0b\u5b9d\u8d35\u7684\u70b9\u8d5e(\u8fd9\u4e2a\u5bf9\u6211\u975e\u5e38\u975e\u5e38\u975e\u5e38\u91cd\u8981)\u3001\u5173\u6ce8\u52a0\u6536\u85cf&#xff0c;\u60a8\u7684\u652f\u6301\u662f\u6211\u521b\u4f5c\u7684\u6700\u5927\u52a8\u529b&#xff01;&#xff01;&#xff01;&#xff01; \u4fe1\u53f7\u91cf \u6982\u5ff5","og_url":"https:\/\/www.wsisp.com\/helps\/65651.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-25T06:32:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125063247-6975b90f5eaee.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/65651.html","url":"https:\/\/www.wsisp.com\/helps\/65651.html","name":"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-25T06:32:48+00:00","dateModified":"2026-01-25T06:32:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/65651.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/65651.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/65651.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u7ebf\u7a0b\u540c\u6b65\u3011\u4fe1\u53f7\u91cf\u4e0e\u73af\u5f62\u961f\u5217\u7684\u751f\u4ea7\u6d88\u8d39\u6a21\u578b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=65651"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65651\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/65647"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=65651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=65651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=65651"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=65651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}