{"id":4142,"date":"2019-04-23T17:53:37","date_gmt":"2019-04-23T09:53:37","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=4142"},"modified":"2019-04-23T17:53:37","modified_gmt":"2019-04-23T09:53:37","slug":"%e8%bf%99-5-%e4%b8%aa%e7%ae%80%e5%8d%95%e7%9a%84%e9%9d%a2%e8%af%95%e9%a2%98%ef%bc%8c%e6%8a%8a%e7%be%a4%e7%82%b8%e4%ba%86","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4142","title":{"rendered":"\u8fd9 5 \u4e2a\u7b80\u5355\u7684\u9762\u8bd5\u9898\uff0c\u628a\u7fa4\u70b8\u4e86"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5927\u5bb6\u90fd\u77e5\u9053\uff0c\u6211\u6700\u8fd1\u5229\u7528\u4e1a\u4f59\u65f6\u95f4\u641e\u4e86\u4e00\u4e2a\u9762\u8bd5\u9898\u5c0f\u7a0b\u5e8f\u3002\u4e5f\u5199\u4e86\u4e0d\u5c11\u5e72\u8d27\u6587\u7ae0\uff0c\u4eca\u5929\u65e9\u4e0a\u5fc3\u8840\u6765\u6f6e\uff0c\u53d1\u4e86 5 \u4e2a\u9762\u8bd5\u9898\u5728\u7fa4\u91cc\uff0c\u7ed3\u679c\u7fa4\u70b8\u4e86\uff0c\u4e0d\u5c11\u4eba\u56de\u7b54\u4e0d\u5c11\u6765\uff0c\u518d\u4e0d\u662f\u5c31\u63cf\u8ff0\u7684\u4e0d\u5168\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9762\u8bd5\u9898\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>volatile\u00a0\u7684\u7528\u9014\u662f\u5565\uff1f \u80fd\u4fdd\u8bc1\u591a\u7ebf\u7a0b\u5171\u4eab\u53d8\u91cf\u7684\u539f\u5b50\u6027\u4e48\uff1f<\/li><li>threadlocal \u662f\u7ebf\u7a0b\u5b89\u5168\u7684\u4e48\u7684\uff1f\u5177\u4f53\u4ec0\u4e48\u4e1a\u52a1\u573a\u666f\u4f7f\u7528threadlocal<\/li><li>\u4ec0\u4e48\u662f\u5f3a\u5f15\u7528\u3001\u8f6f\u5f15\u7528\u3001\u5f31\u5f15\u7528\u3001\u865a\u5f15\u7528\uff1f<\/li><li>wait\u65b9\u6cd5\u91ca\u653e\u9501\u4e48\uff1f notify\/notifyall \u91ca\u653e\u9501\u4e48\uff1fsleep \u91ca\u653e\u9501\u4e48\uff1f<\/li><li>LinkedHashMap \u7684\u539f\u7406\u548c\u4f7f\u7528\u573a\u666f\uff1f<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u9898\u5176\u5b9e\u5f88\u7b80\u5355\u4e86\uff0c\u800c\u4e14\u6211\u7684\u516c\u4f17\u53f7\u91cc\u57fa\u672c\u4e0a\u90fd\u5199\u8fc7\u8fd9\u4e9b\u77e5\u8bc6\u70b9\u3002\u6bd4\u5982\uff1avolatile \u7684\u7528\u9014\u662f\u5565\uff1f \u80fd\u4fdd\u8bc1\u591a\u7ebf\u7a0b\u5171\u4eab\u53d8\u91cf\u7684\u539f\u5b50\u6027\u4e48\uff1f\u8fd9\u9898\u662f\u591a\u4e48\u7684\u719f\u6089\uff0c\u76f8\u4fe1\u4e0d\u5c11\u770b\u8fc7\u6211\u7684\u8fd9\u7bc7\u6587\u7ae0\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/Jwh-wbgHp517FIxKHcfqmQ\">Java \u7ebf\u7a0b\u5b89\u5168\u76843\u5927\u6838\u5fc3\uff1a\u539f\u5b50\u6027\u3001\u53ef\u89c1\u6027\u3001\u6709\u5e8f\u6027<\/a>\u300b\u7684\u5e94\u8be5\u90fd\u80fd\u56de\u7b54\u4e0a\u6765\u3002\u53ef\u60dc\u554a\uff0c\u5f88\u591a\u4eba\u4e0d\u770b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u6bd4\u5982\u7b2c\u4e8c\u9898\uff1athreadlocal \u662f\u7ebf\u7a0b\u5b89\u5168\u7684\u4e48\u7684\uff1f\u5177\u4f53\u4ec0\u4e48\u4e1a\u52a1\u573a\u666f\u4f7f\u7528threadlocal\uff1f\u6211\u5728 2018 \u5e74\u5c31\u5199\u8fc7\u76f8\u5173\u6587\u7ae0\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/1qGNYW61n7Tt57OWv_MG2w\">\u8fd9\u6837\u4f7f\u7528 ThreadLocal \u5bf9\u5417\uff1f<\/a>\u300b\u3002\u867d\u7136\u90a3\u4e2a\u65f6\u5019\u6392\u7248\u8fd8\u4e0d\u597d\uff0c\u4f46\u662f Threadlocal \u7edd\u5bf9\u662f\u9ad8\u9891\u9762\u8bd5\u9898\u4e86\uff0c\u6240\u4ee5\u5fc5\u987b\u8981\u8bb0\u7262\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u770b\u7b2c\u4e09\u9898\uff1a\u4ec0\u4e48\u662f\u5f3a\u5f15\u7528\u3001\u8f6f\u5f15\u7528\u3001\u5f31\u5f15\u7528\u3001\u865a\u5f15\u7528\uff1f\u6211\u8bb0\u5f97\u6700\u8fd1\u4e00\u4e2a\u6708\u5de6\u53f3\u624d\u53d1\u4e86\u7c7b\u4f3c\u7684\u6587\u7ae0\u5427\u3002\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/bsPxOC7L3qnKN98LYAvySw\">\u624b\u628a\u624b\u6559\u4f60\u901a\u8fc7Java\u4ee3\u7801\u4f53\u9a8c\u5f3a\u5f15\u7528\u3001\u8f6f\u5f15\u7528\u3001\u5f31\u5f15\u7528\u3001\u865a\u5f15\u7528\u7684\u533a\u522b<\/a>\u300b\u662f\u5426\u5f88\u773c\u719f\u3002\u4f46\u662f\u5bf9\u4e0d\u8d77\u53ea\u6709\u94b1\u624d\u80fd\u6253\u52a8\u6211\uff0c\u773c\u719f\u6839\u672c\u4e0d\u503c\u94b1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u56db\u9898\uff1await\u65b9\u6cd5\u91ca\u653e\u9501\u4e48\uff1f notify\/notifyall \u91ca\u653e\u9501\u4e48\uff1fsleep \u91ca\u653e\u9501\u4e48\uff1f\u4e5f\u662f\u8001\u65e9\u5c31\u5199\u8fc7\u7684\u3002\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/o1YAJQXBKruYgWwwqvyqmw\">\u4ee3\u7801\u4e2d\u7684Thread.sleep(0) \u6709\u4ec0\u4e48\u610f\u4e49\uff1f\u662f\u5199\u9519\u4e86\u5417\uff1f<\/a>\u300b\u3001\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/C01DOMa3AGAJBW07gEZXbQ\">java\u7ebf\u7a0b\u6700\u719f\u6089\u800c\u53c8\u964c\u751f\u7684\u77e5\u8bc6\u70b9\uff1asleep\u4e0ewait<\/a>\u300b\u3002\u8fd9\u4e9b\u77e5\u8bc6\u70b9\u90fd\u5728\u4e8e\u5e73\u65f6\u7684\u79ef\u7d2f\uff0c\u4f60\u5e73\u65f6\u5728\u5730\u94c1\u4e0a\uff0c\u4e5f\u6216\u8005\u662f\u5728\u516c\u4ea4\u4e0a\u90fd\u662f\u4e0d\u9519\u7684\u5b66\u4e60\u65f6\u673a\u3002\u4e00\u5b9a\u8981\u4ece\u6839\u4e0a\u6539\u53d8\u81ea\u5df1\uff0c996 \u624d\u80fd\u4e0e\u4f60\u65e0\u5173\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e94\u9898\uff1aLinkedHashMap \u7684\u539f\u7406\u548c\u4f7f\u7528\u573a\u666f\uff1f\u672c\u6708\u624d\u5199\u8fc7\u7684\u5185\u5bb9\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/sgR7zTNMo8r5fGd4k1V6lA\">\u6df1\u5165\u6d45\u51faLinkedHashMap\u539f\u7406\u548c\u6e90\u7801\u89e3\u6bd2<\/a>\u300b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u867d\u7136\u5e73\u65f6\u5927\u5bb6\u90fd\u9762\u5411\u767e\u5ea6\u7f16\u7a0b\uff0c\u4f46\u4e5f\u8981\u7559\u610f\u4e00\u4e0b\uff0c\u9762\u5411\u9762\u8bd5\u7f16\u7a0b\u3002\u5e73\u65f6\u8981\u5173\u6ce8\u67d0\u9879\u6280\u672f\u7684\u5177\u4f53\u5b9e\u73b0\uff0c\u67d0\u9879\u6280\u672f\u7684\u5e95\u5c42\u539f\u7406\uff0c\u8fd8\u8981\u7a0d\u5fae\u7684\u8bb0\u6e05\u695a\u4e00\u4e9b\u6982\u5ff5\uff0c\u5939\u5e26\u4e00\u4e9b\u7b80\u5355\u7684\u7b97\u6cd5\u3002\u505a\u5230\u8fd9\u4e9b BAT \u7684\u5927\u95e8\u4e3a\u4f60\u4eec\u655e\u5f00\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u66f4\u591a\u7cbe\u5f69\u9762\u8bd5\u9898\uff0c\u8bf7\u5173\u6ce8\u6211\u7684\u7a0b\u5e8f\u5458\u9898\u5e93\u5c0f\u7a0b\u5e8f\u3002\u505a\u5230\u5fc3\u4e2d\u6709\u6570\uff0c\u9762\u8bd5\u65e0\u654c\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4142\">\u8fd9 5 \u4e2a\u7b80\u5355\u7684\u9762\u8bd5\u9898\uff0c\u628a\u7fa4\u70b8\u4e86<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u90fd\u77e5\u9053\uff0c\u6211\u6700\u8fd1\u5229\u7528\u4e1a\u4f59\u65f6\u95f4\u641e\u4e86\u4e00\u4e2a\u9762\u8bd5\u9898\u5c0f\u7a0b\u5e8f\u3002\u4e5f\u5199\u4e86\u4e0d\u5c11\u5e72\u8d27\u6587\u7ae0\uff0c\u4eca\u5929\u65e9\u4e0a\u5fc3\u8840\u6765\u6f6e\uff0c\u53d1\u4e86 5 \u4e2a\u9762\u8bd5\u9898\u5728 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[472,546,579,62,410],"class_list":["post-4142","post","type-post","status-publish","format-standard","hentry","category-java","tag-rest","tag-546","tag-579","tag-62","tag-410"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4142"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4142\/revisions"}],"predecessor-version":[{"id":4143,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4142\/revisions\/4143"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}