{"id":2134,"date":"2020-07-05T17:16:39","date_gmt":"2020-07-05T09:16:39","guid":{"rendered":"https:\/\/coderbee.net\/?p=2134"},"modified":"2020-07-05T17:17:51","modified_gmt":"2020-07-05T09:17:51","slug":"disruptor-%e4%b8%ba%e4%bb%80%e4%b9%88%e9%82%a3%e4%b9%88%e5%bf%ab%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/coderbee.net\/index.php\/concurrent\/20200705\/2134","title":{"rendered":"Disruptor \u4e3a\u4ec0\u4e48\u90a3\u4e48\u5feb\uff1f"},"content":{"rendered":"<p>\u4e00\u4e2a\u7b80\u77ed\u7684\u7b14\u8bb0\u3002<\/p>\n<p>Disruptor \u5feb\u7684\u6838\u5fc3\u79d8\u8bc0\u662f\uff1a\u57fa\u4e8e\u6570\u7ec4\u3001\u7a7a\u95f4\u5c40\u90e8\u6027\u826f\u597d\u3001\u6d88\u9664\u4f2a\u5171\u4eab\u3001\u65e0\u9501\u3001\u652f\u6301\u6279\u91cf\u6d88\u8d39\u3002<\/p>\n<h1>1. \u57fa\u4e8e\u6570\u7ec4\u7684\u5185\u5b58\u5c40\u90e8\u6027<\/h1>\n<p>Disruptor \u5e95\u5c42\u662f\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u73af\u5f62\u6570\u7ec4\uff0c\u521d\u59cb\u5316\u7684\u65f6\u5019\u4f1a\u987a\u5e8f\u521b\u5efa\u4e0e\u6570\u7ec4\u957f\u5ea6\u4e00\u6837\u6570\u91cf\u7684\u5bf9\u8c61\uff0c\u4ee5\u4fbf\u8ba9\u8fd9\u4e9b\u5bf9\u8c61\u5728\u5185\u5b58\u4e0a\u5c3d\u91cf\u6328\u7740\u7684\u3002<\/p>\n<p>\u987a\u5e8f\u521b\u5efa\u4e0e\u968f\u673a\u521b\u5efa\u5728\u5185\u5b58\u4e0a\u7684\u5dee\u522b\u53ef\u4ee5\u5bf9\u6bd4\u4e0b\u9762\u4e24\u5f20\u56fe\uff08\u6765\u81ea\u6781\u5ba2\u65f6\u95f4\u4e13\u680f\u300aJava\u5e76\u53d1\u7f16\u7a0b\u5b9e\u6218\u300b\uff09\uff1a<br \/>\n<a href=\"https:\/\/coderbee.net\/wp-content\/uploads\/2020\/07\/ringbuffer-mem-layout.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2020\/07\/ringbuffer-mem-layout.jpg\" alt=\"\" width=\"246\" height=\"292\" class=\"alignnone size-full wp-image-2133\" \/><\/a><\/p>\n<p><a href=\"https:\/\/coderbee.net\/wp-content\/uploads\/2020\/07\/arrayblockingqueue-mem-layout.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2020\/07\/arrayblockingqueue-mem-layout.jpg\" alt=\"\" width=\"246\" height=\"216\" class=\"alignnone size-full wp-image-2132\" \/><\/a><\/p>\n<p>\u5f80\u961f\u5217\u91cc\u5199\u5165\u4e8b\u4ef6\u65f6\uff0c\u9700\u8981\u628a\u4e8b\u4ef6\u7684\u5c5e\u6027\u62f7\u8d1d\u5230\u8fd9\u4e9b\u9884\u521b\u5efa\u597d\u7684\u5bf9\u8c61\u91cc\uff0c\u4ee5\u4fdd\u6301\u5185\u5b58\u7684\u5c40\u90e8\u6027\u3002<\/p>\n<blockquote><p>\n  \u8fd9\u91cc\u7684\u4e00\u4e2a\u9690\u6027\u8981\u6c42\u662f\uff1a\u4e8b\u4ef6\u7684\u5c5e\u6027\u5e94\u8be5\u5c3d\u91cf\u662f\u57fa\u672c\u7c7b\u578b\uff0c\u5982\u679c\u662f\u5bf9\u8c61\u7c7b\u578b\uff0c\u5b58\u7684\u662f\u5f15\u7528\uff0c\u8bbf\u95ee\u5f15\u7528\u6307\u5411\u7684\u503c\u65f6\u53ef\u80fd\u5c31\u662f\u968f\u673a\u7684\u5185\u5b58\u8bbf\u95ee\u3002\n<\/p><\/blockquote>\n<p><!--more--><\/p>\n<h1>2. \u65e0\u9501<\/h1>\n<p>Disruptor \u91c7\u7528\u65e0\u9501\u3001\u4f46\u662f\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\u3002\u65e0\u9501\u5b9e\u73b0\u6d88\u9664\u4e86\u9501\u7ade\u4e89\u3001\u7b49\u5f85\u3002<\/p>\n<p>\u5b9e\u73b0\u4e0a\uff0c\u6bcf\u4e2a\u5199\u5165\u8005\u3001\u8bfb\u53d6\u8005\u90fd\u7ef4\u62a4\u4e00\u4e2a\u81ea\u5df1\u7684\u4e0b\u6807\u3002\u8bfb\u53d6\u8005\u4f1a\u8bfb\u53d6\u5199\u5165\u8005\u7684\u4e0b\u6807\u6765\u5224\u65ad\u7ed9\u5b9a\u4f4d\u7f6e\u662f\u5426\u6709\u6709\u6548\u7684\u6570\u636e\uff0c\u5199\u5165\u8005\u4e5f\u4f1a\u8bfb\u53d6\u8bfb\u53d6\u8005\u7684\u4e0b\u6807\u6765\u5224\u7b49\u7ed9\u5b9a\u4f4d\u7f6e\u7684\u6570\u636e\u662f\u5426\u5df2\u7ecf\u88ab\u6d88\u8d39\u3002<\/p>\n<p>Disruptor \u4fdd\u8bc1\u6bcf\u4e2a\u4e0b\u6807\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u4f1a\u4fee\u6539\uff0c\u56e0\u800c\u4e0d\u9700\u8981\u9501\u6765\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\u6027\u3002<\/p>\n<h1>3. \u6d88\u9664\u4f2a\u5171\u4eab<\/h1>\n<p>\u4f2a\u5171\u4eab\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u540c\u4e00\u4e2a\u7f13\u5b58\u884c\u7684\u6570\u636e\uff0c\u6709\u81f3\u5c11\u4e24\u4e2a CPU \u5904\u7406\u5668\u6838\u8fdb\u884c\u4fee\u6539\uff0cCPU A \u548c B \u5206\u5e03\u8981\u4fee\u6539\u7684\u6570\u636e mem-A\/mem-B \u4f1a\u52a0\u8f7d\u5230\u540c\u4e00\u7f13\u5b58\u884c\uff0cCPU A \u4fee\u6539 mem-A \u4f1a\u5bfc\u81f4 CPU B \u7f13\u5b58\u884c\u91cc\u5931\u6548\uff0c\u9700\u8981\u91cd\u65b0\u4ece\u4e3b\u5b58\u52a0\u8f7d\u6570\u636e\uff0c\u4ece\u800c\u5bfc\u81f4\u6548\u7387\u964d\u4f4e\u3002<\/p>\n<p>Disruptor \u7684\u5b9e\u73b0\u4fdd\u8bc1\u524d\u9762\u7684\u6bcf\u4e2a\u4e0b\u6807\u4f1a\u72ec\u5360\u4e00\u4e2a\u7f13\u5b58\u884c\uff0c\u4ece\u800c\u6d88\u9664\u4f2a\u5171\u4eab\u3002<\/p>\n<h1>4. \u6279\u91cf\u6d88\u8d39<\/h1>\n<p>\u6279\u91cf\u6d88\u8d39\u6bd4\u8f83\u5bb9\u6613\u7406\u89e3\uff0c\u6d88\u8d39\u8005\u987a\u5e8f\u8bfb\u53d6\u6570\u7ec4\u7684\u4e00\u6279\u6570\u636e\u8fdb\u884c\u5904\u7406 \u76f8\u6bd4\u4e00\u6b21\u53ea\u80fd\u5904\u7406\u4e00\u4e2a\u7684\u6548\u7387\u66f4\u9ad8\u3002<\/p>\n<p>\u6279\u91cf\u4e5f\u66f4\u597d\u5730\u5229\u7528\u4e86\u5c40\u90e8\u6027\u4f18\u5316\u3002<\/p>\n<h1>5. \u53c2\u8003\u8d44\u6599<\/h1>\n<p><a href=\"https:\/\/www.martinfowler.com\/articles\/lmax.html\">The LMAX Architecture<\/a><\/p>\n<p><a href=\"https:\/\/coderbee.net\/?p=2113\">LMAX \u67b6\u6784\u2013\u7b14\u8bb0<\/a><\/p>\n<p><a href=\"https:\/\/coderbee.net\/?p=566\">False Sharing \u4f2a\u5171\u4eab \u2013 \u8bd1<\/a><\/p>\n<hr \/>\n<p>\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u5fae\u4fe1\u516c\u4f17\u53f7: <strong>coderbee\u7b14\u8bb0<\/strong> \u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"258\" height=\"258\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2019\/01\/coderbee-note.jpg\" class=\"alignnone size-full wp-image-1707\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u7b80\u77ed\u7684\u7b14\u8bb0\u3002 Disruptor \u5feb\u7684\u6838\u5fc3\u79d8\u8bc0\u662f\uff1a\u57fa\u4e8e\u6570\u7ec4\u3001\u7a7a\u95f4\u5c40\u90e8\u6027\u826f\u597d\u3001 &hellip; <a href=\"https:\/\/coderbee.net\/index.php\/concurrent\/20200705\/2134\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121],"tags":[79,351,148],"_links":{"self":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2134"}],"collection":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/comments?post=2134"}],"version-history":[{"count":5,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2134\/revisions"}],"predecessor-version":[{"id":2139,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2134\/revisions\/2139"}],"wp:attachment":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/media?parent=2134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/categories?post=2134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/tags?post=2134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}