{"id":15,"date":"2023-03-22T14:27:48","date_gmt":"2023-03-22T06:27:48","guid":{"rendered":"https:\/\/code.lingapi.top\/?p=15"},"modified":"2023-03-22T14:27:49","modified_gmt":"2023-03-22T06:27:49","slug":"%e5%a4%9a%e7%ba%bf%e7%a8%8b%e5%85%b1%e4%ba%ab%e6%95%b0%e6%8d%ae%e5%90%8c%e6%ad%a5-%e5%86%85%e5%ad%98%e5%b1%8f%e9%9a%9c","status":"publish","type":"post","link":"https:\/\/code.lingapi.top\/?p=15","title":{"rendered":"\u591a\u7ebf\u7a0b\u5171\u4eab\u6570\u636e\u540c\u6b65-\u5185\u5b58\u5c4f\u969c"},"content":{"rendered":"\n<p>Lua VM ling.choice()API\u4e2d\uff0c\u4f7f\u7528\u8fdb\u7a0b\u95f4\u901a\u4fe1\u624b\u6bb5\u53d1\u9001UI\u8bf7\u6c42\u5230JNI\uff0c\u540e\u963b\u585eAPI\uff0c\u7b49\u5f85JNI\u8fd4\u56de\u4e4b\u540e\uff0c\u5c06\u6570\u636e\u8fd4\u56de\u7ed9Lua VM\u3002\u5728\u7b49\u5f85JNI\u8fd4\u56de\u65f6\uff0c\u4f7f\u7528\u8f6e\u8be2Flag\u53d8\u91cf\u7684\u65b9\u6cd5\u63a7\u5236\u8fd4\u56de\u65f6\u673a\uff0c\u906d\u9047\u5185\u5b58\u5c4f\u969c\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u5185\u5b58\u5c4f\u969c\u662f\u6307\u5728\u591a\u6838CPU\u4e2d\uff0c\u4e0d\u540c\u7ebf\u7a0b\u8fd0\u884c\u5728\u4e0d\u540c\u6838\u5fc3\u4e4b\u4e0a\uff0c\u7ebf\u7a0b\u5bf9\u5171\u4eab\u53d8\u91cf\u7684\u4fee\u6539\u5b58\u5728\u4e0e\u5f53\u524d\u6838\u5fc3\u7684\u5bc4\u5b58\u5668\u4e0a\uff0c\u5e76\u6ca1\u6709\u7acb\u5373\u5199\u5165\u5185\u5b58\u3002\u5176\u4ed6\u6838\u5fc3\u4ece\u5185\u5b58\u8f7d\u5165\u6570\u636e\u4e5f\u9700\u8981\u65f6\u673a\u3002\u5bfc\u81f4\u5e76\u53d1\u7f16\u7a0b\u4e2d\u5f53\u524d\u7ebf\u7a0b\u6240\u505a\u7684\u66f4\u6539\u5728\u5176\u5b83\u7ebf\u7a0b\u4e2d\u4e0d\u4fdd\u8bc1\u4e00\u5b9a\u53ef\u89c1\u3002\u540c\u6b65\u65f6\u673a\u662f\u4e0d\u786e\u5b9a\u7684\u3002<\/p>\n\n\n\n<p>\u8981\u89e3\u51b3\u5e76\u53d1\u7f16\u7a0b\u4e2d\u7684\u5185\u5b58\u5c4f\u969c\u95ee\u9898\uff0c\u9700\u8981\u4f7f\u7528\u540c\u6b65\u5143\u8bed\u6765\u964d\u4f4e\u5f71\u54cd\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528flag\u6765\u5c06\u5f02\u6b65\u64cd\u4f5c\u6539\u4e3a\u540c\u6b65\u65f6\uff0c\u9700\u8981\u4f7f\u7528std::atomic\u6765\u5b9a\u4e49\u539f\u5b50\u7684flag\u5bf9\u8c61\u3002\u6b64\u65f6\u5bf9flag\u7684\u8bfb\u548c\u5199\u64cd\u4f5c\u90fd\u662f\u539f\u5b50\u64cd\u4f5c\uff0c\u4e0d\u53ef\u7ec6\u5206\uff0cstd::atomic\u8fd8\u53ef\u4ee5\u4fdd\u8bc1\u5bf9flag\u7684\u4fee\u6539\u80fd\u7acb\u5373\u540c\u6b65\u5230\u5176\u4ed6\u7ebf\u7a0b\u4e2d\u3002<\/p>\n\n\n\n<p>std::atomic\u662f\u5426\u4f1a\u5e26\u6765\u989d\u5916\u5f00\u9500\u6682\u4e0d\u77e5\u9053\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lua VM ling.choice()API\u4e2d\uff0c\u4f7f\u7528\u8fdb\u7a0b\u95f4\u901a\u4fe1\u624b\u6bb5\u53d1\u9001UI\u8bf7\u6c42\u5230JNI\uff0c\u540e\u963b\u585eAPI\uff0c\u7b49\u5f85J [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":3,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":18,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/18"}],"wp:attachment":[{"href":"https:\/\/code.lingapi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.lingapi.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}