{"id":390,"date":"2021-08-18T00:02:27","date_gmt":"2021-08-17T16:02:27","guid":{"rendered":"https:\/\/blog.cauchyschwarz.com\/?p=390"},"modified":"2021-08-18T00:03:59","modified_gmt":"2021-08-17T16:03:59","slug":"%e6%97%a0%e9%94%81%e9%98%9f%e5%88%97","status":"publish","type":"post","link":"https:\/\/blog.cauchyschwarz.com\/?p=390","title":{"rendered":"\u65e0\u9501\u961f\u5217"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e0c4da315ea\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e0c4da315ea\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#boost%E6%97%A0%E9%94%81%E9%98%9F%E5%88%97\" >boost\u65e0\u9501\u961f\u5217<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#concurrentqueue\" >concurrentqueue<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#%E5%8D%95producer%E5%8D%95consumer%E7%9A%84%E6%97%A0%E9%94%81%E9%98%9F%E5%88%97\" >\u5355producer\u5355consumer\u7684\u65e0\u9501\u961f\u5217<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#folly%E4%B8%AD%E7%9A%84%E5%AE%9E%E7%8E%B0\" >folly\u4e2d\u7684\u5b9e\u73b0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#wikipedia%E7%9A%84%E4%BB%8B%E7%BB%8D\" >wikipedia\u7684\u4ecb\u7ecd<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#%E5%AE%9E%E7%8E%B0\" >\u5b9e\u73b0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#wait-freedom\" >wait-freedom<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#lock-freedom\" >lock-freedom<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#obstruction-freedom\" >obstruction-freedom<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#%E8%AE%BA%E6%96%87%E7%AC%94%E8%AE%B0\" >\u8bba\u6587\u7b14\u8bb0<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#Simple_Fast_and_Practical_Non-Blocking_and_Blocking_Concurrent_Queue_Algorithms\" >Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=390\/#%E6%95%99%E7%A8%8B%E6%96%87%E7%AB%A0\" >\u6559\u7a0b\u6587\u7ae0<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"boost%E6%97%A0%E9%94%81%E9%98%9F%E5%88%97\"><\/span>boost\u65e0\u9501\u961f\u5217<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u8981\u6c42\u91cc\u9762\u5b58\u653e\u7684\u5143\u7d20\u5177\u6709trivial destructor\uff0c\u56e0\u4e3a\u91cc\u9762\u7684\u5143\u7d20\u6709\u53ef\u80fd\u88ab\u5220\u9664\u4e24\u6b21\u3002trivial destructor\u7684\u89e3\u91ca\uff1ahttps:\/\/en.cppreference.com\/w\/cpp\/language\/destructor#:~:text=A%20trivial%20destructor%20is%20a,POD%20types)%20are%20trivially%20destructible.<br>\u4e5f\u5c31\u662f\u8bf4\u5143\u7d20\u7684\u6790\u6784\u51fd\u6570\u662fnop(\u6ce8\u610fnop\u548c\u9ed8\u8ba4\u6790\u6784\u51fd\u6570\u7684\u5dee\u522b\uff0cnop\u662f\u8bf4\u4ec0\u4e48\u90fd\u4e0d\u505a)\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"concurrentqueue\"><\/span>concurrentqueue<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>https:\/\/github.com\/cameron314\/concurrentqueue<br>\u57fa\u4e8ec++11\u7684\u65e0\u9501\u961f\u5217\uff0c\u4f46\u662f\u53ea\u4fdd\u8bc1\u6765\u81ea\u4e8e\u540c\u4e00\u4e2aproducer\u7684\u5143\u7d20\u5728pop\u65f6\u662f\u4fdd\u6301\u539f\u76f8\u5bf9\u987a\u5e8f\u7684\uff0c\u4e0d\u4fdd\u8bc1\u6765\u81ea\u4e8e\u4e0d\u540cproducer\u7684\u5143\u7d20\u5728pop\u65f6\u4fdd\u6301push\u7684\u987a\u5e8f(\u5176\u5b9e\u4e5f\u57fa\u672c\u5408\u7406)\u3002\u652f\u6301bulk push\u548cpop\uff0c\u5728pop\u65f6\u5982\u679c\u9700\u8981\u963b\u585e\u5f0fpop\uff0c\u90a3\u4e48\u5c31\u4f7f\u7528blockingconcurrentqueue\u7248\u672c\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8D%95producer%E5%8D%95consumer%E7%9A%84%E6%97%A0%E9%94%81%E9%98%9F%E5%88%97\"><\/span>\u5355producer\u5355consumer\u7684\u65e0\u9501\u961f\u5217<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p><a href=\"https:\/\/www.drdobbs.com\/parallel\/lock-free-queues\/208801974?pgno=1\u4e00\u79cd\u65e0\u9501\u961f\u5217\u7684\u8bbe\u8ba1\uff0c\u6838\u5fc3\u662f\u53ea\u5728produce\u51fd\u6570\u91cc\u4fee\u6539\u961f\u5217\uff0cconsume\u51fd\u6570\u91cc\u5e76\u6ca1\u6709\u771f\u6b63\u7684\u4fee\u6539\u961f\u5217\uff0c\u53ea\u662f\u8bfb\u53d6\u5143\u7d20\u3002\u4f46\u662f\u8fd9\u4e2a\u5b9e\u73b0\u6709\u4e00\u4e9b\u9650\u5236\uff1a\">https:\/\/www.drdobbs.com\/parallel\/lock-free-queues\/208801974?pgno=1<\/a><\/p>\n\n\n\n<p>\u4e00\u79cd\u65e0\u9501\u961f\u5217\u7684\u8bbe\u8ba1\uff0c\u6838\u5fc3\u662f\u53ea\u5728produce\u51fd\u6570\u91cc\u4fee\u6539\u961f\u5217\uff0cconsume\u51fd\u6570\u91cc\u5e76\u6ca1\u6709\u771f\u6b63\u7684\u4fee\u6539\u961f\u5217\uff0c\u53ea\u662f\u8bfb\u53d6\u5143\u7d20\u3002\u4f46\u662f\u8fd9\u4e2a\u5b9e\u73b0\u6709\u4e00\u4e9b\u9650\u5236\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u53ea\u80fd\u5355producer\u5355consumer\uff1b<\/li><li>iterator\u7684\u64cd\u4f5c\u9700\u8981\u4fdd\u8bc1\u539f\u5b50\u6027\u6216\u8005\u6362\u6210\u5176\u4ed6\u80fd\u4fdd\u8bc1\u539f\u5b50\u6027\u4e14\u4f5c\u7528\u548citerator\u76f8\u5f53\u7684\u7c7b\u578b\uff1b<\/li><li>\u5173\u952e\u53d8\u91cf\u7684\u4fee\u6539\u53ef\u89c1\u6027\u8981\u81ea\u5df1\u4fdd\u8bc1\uff0c\u6bd4\u5982\u4f7f\u7528volatile\u4e4b\u7c7b\u7684\u5173\u952e\u5b57\uff1b<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"folly%E4%B8%AD%E7%9A%84%E5%AE%9E%E7%8E%B0\"><\/span>folly\u4e2d\u7684\u5b9e\u73b0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"wikipedia%E7%9A%84%E4%BB%8B%E7%BB%8D\"><\/span>wikipedia\u7684\u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Non-blocking_algorithm#:~:text=Lock%2Dfreedom,-Lock%2Dfreedom%20allows&amp;text=An%20algorithm%20is%20lock%2Dfree,free%20algorithms%20are%20lock%2Dfree.\">https:\/\/en.wikipedia.org\/wiki\/Non-blocking_algorithm#:~:text=Lock%2Dfreedom,-Lock%2Dfreedom%20allows&amp;text=An%20algorithm%20is%20lock%2Dfree,free%20algorithms%20are%20lock%2Dfree.<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>non-blocking algorithm<br>\u4e00\u4e2a\u975e\u963b\u585e\u7684\u7b97\u6cd5\u9700\u8981\u6ee1\u8db3\uff1a\u4e00\u4e2a\u7ebf\u7a0b\u7684\u5931\u8d25\u6216\u8005\u6302\u8d77\u4e0d\u4f1a\u5bfc\u81f4\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u5931\u8d25\u6216\u8005\u6302\u8d77(failure or suspension)\uff1b<\/li><li>wait free<br>\u4e00\u4e2await free\u7684\u7b97\u6cd5\u9700\u8981\u6ee1\u8db3\uff1a\u4fdd\u8bc1\u6bcf\u4e2a\u7ebf\u7a0b\u90fd\u80fd\u591f\u53d6\u5f97\u8fdb\u5c55(make progress)\uff1b<\/li><li>lock free<br>\u4e00\u4e2alock free\u7684\u7b97\u6cd5\u9700\u8981\u6ee1\u8db3\uff1a\u4fdd\u8bc1\u6574\u4e2a\u7cfb\u7edf\u80fd\u591f\u53d6\u5f97\u8fdb\u5c55\uff1b<\/li><li>obstruction free<\/li><\/ul>\n\n\n\n<p>\u53ef\u4ee5\u770b\u51fa\u8fd9\u51e0\u91cd\u6982\u5ff5\u7684&#8221;\u5e76\u884c&#8221;\u7a0b\u5ea6\uff1anon-blocking &lt; obstruction free &lt; lock free &lt; wait free\uff1b<br>\u4e3a\u4ec0\u4e48\u9700\u8981\u975e\u963b\u585e\u7684\u7b97\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6709\u65f6\u5019\u6211\u4eec\u5c31\u662f\u4e0d\u60f3\u6302\u8d77\u7ebf\u7a0b\uff0c\u6bd4\u5982\u5bf9\u4e8e\u6267\u884c\u5b9e\u65f6\u4efb\u52a1\u7684\u7ebf\u7a0b\uff1b<\/li><li>\u4f7f\u7528\u9501\u53ef\u80fd\u5bfc\u81f4\u6d3b\u9501\uff0c\u6b7b\u9501\uff0c\u4f18\u5148\u7ea7\u53cd\u8f6c(priority inversion)\uff0c\u9501\u7684\u7c92\u5ea6\u5212\u5206\u7b49\u95ee\u9898\uff1b<\/li><li>\u975e\u963b\u585e\u7b97\u6cd5\u53ef\u4ee5\u5728\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\u4f7f\u7528\uff1b<\/li><li>\u975e\u963b\u585e\u7b97\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u589e\u52a0\u7a0b\u5e8f\u5e76\u884c\u6267\u884c\u7684\u65f6\u95f4\u800c\u4e0d\u662f\u82b1\u8d39\u65f6\u95f4\u53bb\u6267\u884c\u4e32\u884c\u7684\u64cd\u4f5c\uff1b<\/li><\/ul>\n\n\n\n<p>\u8fd9\u91cc\u7684non-blocking\u5c45\u7136\u6700\u5148\u662f\u7528\u6765\u63cf\u8ff0\u7535\u4fe1\u7f51\u7edc\u7684(\u4ee5\u524d\u90a3\u79cd\u9700\u8981\u63a5\u7ebf\u7684\u7535\u8bdd\u7f51\u7edc)\uff0c\u4fdd\u8bc1\u7528\u6237\u6bcf\u6b21\u6253\u7535\u8bdd\u65f6\uff0c\u7ebf\u8def\u603b\u662f\u80fd\u591f\u63a5\u901a\uff0e<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%9E%E7%8E%B0\"><\/span>\u5b9e\u73b0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u51e0\u4e4e\u6240\u6709\u7684\u975e\u963b\u585e\u7b97\u6cd5\u4f9d\u8d56\u4e8eatomic read-modify-write\u539f\u8bed\uff0c\u800c\u539f\u5b50RMW\u539f\u8bed\u4e2d\u6700\u5e7f\u4e3a\u4eba\u77e5\u7684\u662fcompare and swap(CAS)\uff0e\u5173\u952e\u533a\u7b49\u673a\u5236\u603b\u662f\u57fa\u4e8e\u8fd9\u4e9b\u539f\u8bedRMW\u64cd\u4f5c\u5b9e\u73b0\uff0c\u800c\u5982\u679c\u60f3\u5b9e\u73b0non-blocking\u7b97\u6cd5\uff0c\u5219\u9700\u8981\u81ea\u5df1\u7f16\u7a0b\u64cd\u4f5c\u8fd9\u4e9b\u5e95\u5c42\u539f\u8bed\uff0e<\/p>\n\n\n\n<p>\u5df2\u7ecf\u6709\u5f88\u591a\u8bba\u6587\u7814\u7a76\u4e86\u5982\u4f55\u5b9e\u73b0\u975e\u963b\u585e\u7684\u57fa\u7840\u6570\u636e\u7ed3\u6784\uff0c\u8fd9\u4e9b\u6570\u636e\u7ed3\u6784\u53ef\u4ee5\u5141\u8bb8\u7ebf\u7a0b\u4e4b\u95f4\u4ee5\u5f02\u6b65\u7684\u65b9\u5f0f\u4ea4\u6362\u6570\u636e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>stack<\/li><li>queue<\/li><li>set<\/li><li>hash table<\/li><\/ul>\n\n\n\n<p>\u7591\u95ee\uff1alist,tree\u8fd9\u4e9b\u5462\uff1f<\/p>\n\n\n\n<p>\u53e6\u5916\u4e5f\u6709\u4e00\u4e9b\u975e\u963b\u585e\u7684\u6570\u636e\u7ed3\u6784\u8db3\u591f\u7b80\u5355\u4ee5\u81f3\u4e8e\u4e0d\u9700\u8981\u4f7f\u7528\u7279\u522b\u7684\u539f\u5b50\u539f\u8bed\uff0c\u5305\u62ec\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u5355reader\u5355writer\u7684\u73af\u5f62FIFO\u7f13\u51b2\u533a\uff1b<\/li><li>\u5355writer\u4efb\u610f\u6570\u91cfreader\u7684RCU\uff1b<\/li><li>\u591awriter\u4efb\u610f\u6570\u91cfreader\u7684RCU\uff1b<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"wait-freedom\"><\/span>wait-freedom<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>wait free\u5176\u5b9e\u5c31\u662f\u6bcf\u4e2a\u64cd\u4f5c\u90fd\u4f1a\u6709\u4e00\u4e2a\u6267\u884c\u6b65\u6570\u7684\u4e0a\u9650\uff0c\u8fd9\u4e2a\u6027\u8d28\u5bf9\u4e8e\u5b9e\u65f6\u7cfb\u7edf\u975e\u5e38\u91cd\u8981\uff0e1980\u5e74\u4ee3\u4eba\u4eec\u8bc1\u660e\u4e86\u6240\u6709\u7b97\u6cd5\u90fd\u53ef\u4ee5\u5b9e\u73b0\u4e3await free\uff0c\u53ea\u662fwait free\u7684\u7b97\u6cd5\u53ef\u80fd\u5e76\u4e0d\u6bd4\u5f97\u4e0a\u73b0\u6709\u7684\u963b\u585e\u7248\u672c\u7684\u7b97\u6cd5\uff0e<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>lock-free queue\u7684\u8bba\u6587<br><a href=\"https:\/\/dl.acm.org\/doi\/10.1145\/248052.248106\">Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms<\/a><br>https:\/\/lrita.github.io\/2020\/04\/24\/michael-lockfree-queue\/ \u522b\u4eba\u7684\u8bba\u6587\u7b14\u8bb0<\/li><li>wait-free queue\u7684\u8bba\u6587<br><a href=\"http:\/\/www.cs.technion.ac.il\/~erez\/Papers\/wfquque-ppopp.pdf\">Wait-free queues with multiple enqueuers and dequeuers<\/a>\uff0c\u8fd9\u662f\u57fa\u4e8e\u4e0a\u9762lock-free queue\u5b9e\u73b0\u7684wait-free\uff0c\u4f46\u662f\u6027\u80fd\u6bd4\u4e0a\u9762\u7684lock-free queue\u5dee\uff1b<\/li><li>wait-free queue\u7684\u8bba\u6587<br><a href=\"https:\/\/dl.acm.org\/doi\/10.1145\/2145816.2145835\">A method for creating fast wait-free data structures<\/a>\uff0c\u8fd9\u6539\u8fdb\u4e86\uff12\u4e2d\u7684wait-free queue\uff0c\u6027\u80fd\u548c1\u4e2d\u7684lock free\u4e00\u6837\u597d\uff1b<\/li><li>wait-free\u7b97\u6cd5\u7684\u8bba\u6587<br><a href=\"https:\/\/dl.acm.org\/doi\/10.1145\/2692916.2555261\">A Practical Wait-Free Simulation for Lock-Free Data Structures<\/a>\uff0c\u63d0\u51fa\u4e86\u5982\u4f55\u57fa\u4e8elock-free\u7684\u7b97\u6cd5\u751f\u6210wait-free\u7684\u7248\u672c\uff1b<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"lock-freedom\"><\/span>lock-freedom<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"obstruction-freedom\"><\/span>obstruction-freedom<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4e00\u4e2a\u7ebf\u7a0b\u5728\u65e0\u5e72\u6270(\u5176\u4ed6\u7ebf\u7a0b\u90fd\u6302\u8d77\/\u6ca1\u6709\u7ade\u4e89)\u7684\u60c5\u51b5\u4e0b\u603b\u662f\u80fd\u591f\u5728\u6709\u9650\u6b65\u5185\u5b8c\u6210\u81ea\u5df1\u7684\u64cd\u4f5c\uff0e<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AE%BA%E6%96%87%E7%AC%94%E8%AE%B0\"><\/span>\u8bba\u6587\u7b14\u8bb0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Simple_Fast_and_Practical_Non-Blocking_and_Blocking_Concurrent_Queue_Algorithms\"><\/span>Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8fd9\u7bc7\u6587\u7ae0\u63d0\u4e86\u4e24\u4e2a\u7b97\u6cd5\uff0c\u4e00\u4e2a\u662f\u65e0\u9501\u961f\u5217\u7684\u5b9e\u73b0\uff0c\u53e6\u5916\u4e00\u4e2a\u662f\u7528\u4e86\u4e24\u4e2a\u9501\u7684\u961f\u5217\uff0c\u8fd9\u4e24\u4e2a\u7b97\u6cd5\u90fd\u4f18\u4e8e\u53ea\u6709\u4e00\u4e2a\u9501\u7684\u961f\u5217\uff0c\u65e0\u9501\u961f\u5217\u6027\u80fd\u6700\u597d\uff0e\u5728\u6ca1\u6709CAS\u652f\u6301\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u6709\u4e24\u4e2a\u9501\u7684\u961f\u5217\uff0e<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ABA\u95ee\u9898<br>\u8fdb\u884cCAS\u64cd\u4f5c\uff0c\u7a0b\u5e8f\u4f1a\u5148\u8bb0\u5f55\u8be5\u5730\u5740\u4fdd\u5b58\u7684\u65e7\u503c\uff0c\u7136\u540e\u8ba1\u7b97\u51fa\u4e00\u4e2a\u65b0\u503c\uff0c\u518d\u8c03\u7528CAS\u6307\u4ee4\u5c06\u8be5\u5730\u5740\u7684\u5185\u5bb9\u548c\u65e7\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c\u5982\u679c\u76f8\u540c\u5c31\u5c06\u65b0\u503c\u5199\u5230\u8be5\u5730\u5740\uff0e\u4f46\u5b9e\u9645\u60c5\u51b5\u662f\u8be5\u5730\u5740\u7684\u503c\u53ef\u80fd\u88ab\u5176\u4ed6\u7ebf\u7a0b\u4fee\u6539\u8fc7\u591a\u6b21\uff0c\u53ea\u662f\u6700\u7ec8\u53c8\u6539\u56de\u4e86\u8be5\u5730\u5740\u7684\u539f\u503c\uff0e\u5f88\u591a\u7b97\u6cd5\u4e0d\u80fd\u533a\u5206\u51fa\u8fd9\u79cd\u60c5\u51b5\uff0c\u56e0\u6b64\u5c31\u53ef\u80fd\u5728\u7b97\u6cd5\u903b\u8f91\u4e0a\u4ea7\u751f\u95ee\u9898\uff0e\u56e0\u4e3aCAS\u6bd4\u8f83\u7684\u5bf9\u8c61\u957f\u5ea6\u6709\u9650\uff0c\u6240\u4ee5\u5f88\u591a\u65e0\u9501\u961f\u5217\u7b97\u6cd5\u6ca1\u6cd5\u6bd4\u8f83\u5bf9\u8c61\uff0c\u53ea\u80fd\u6bd4\u8f83\u5bf9\u8c61\u7684\u6307\u9488\uff0c\u800c\u7531\u4e8e\u5185\u5b58\u7ba1\u7406\u673a\u5236\u5f88\u591a\u5bf9\u8c61\u5206\u914d\u7684\u5730\u5740\u90fd\u4f1a\u88ab\u91cd\u7528\uff0c\u56e0\u6b64\u5c31\u5bfc\u81f4\u4e86ABA\u95ee\u9898\uff0e<\/li><\/ul>\n\n\n\n<p>\u53c2\u8003\u8bba\u6587\uff1ahttp:\/\/www.cs.technion.ac.il\/~erez\/Papers\/wfquque-ppopp.pdf<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%99%E7%A8%8B%E6%96%87%E7%AB%A0\"><\/span>\u6559\u7a0b\u6587\u7ae0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p><a href=\"https:\/\/www.infoq.com\/news\/2014\/10\/cpp-lock-free-programming\/\">https:\/\/www.infoq.com\/news\/2014\/10\/cpp-lock-free-programming\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>boost\u65e0\u9501\u961f\u5217 \u8981\u6c42\u91cc\u9762\u5b58\u653e\u7684\u5143\u7d20\u5177\u6709trivial destructor\uff0c\u56e0\u4e3a\u91cc\u9762\u7684\u5143\u7d20\u6709\u53ef\u80fd\u88ab\u5220\u9664\u4e24\u6b21\u3002trivial destructor\u7684\u89e3\u91ca\uff1ahttps:\/\/en.cppreferenc&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[26,44],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-10","tag-algorithm","tag-lockfree"],"_links":{"self":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=390"}],"version-history":[{"count":2,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions\/392"}],"wp:attachment":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}