{"id":233222,"date":"2020-12-29T09:45:35","date_gmt":"2020-12-29T01:45:35","guid":{"rendered":"http:\/\/4563.org\/?p=233222"},"modified":"2020-12-29T09:45:35","modified_gmt":"2020-12-29T01:45:35","slug":"python-%e7%ba%bf%e7%a8%8b%e6%b1%a0%ef%bc%8c%e6%9c%89%e6%b2%a1%e6%9c%89%e4%bb%80%e4%b9%88%e5%8a%9e%e6%b3%95%e8%83%bd%e7%a1%ae%e8%ae%a4%e5%88%b0%e5%bd%93%e5%89%8d%e7%ba%bf%e7%a8%8b%e6%b1%a0%e4%b8%ad","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=233222","title":{"rendered":"Python \u7ebf\u7a0b\u6c60\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u80fd\u786e\u8ba4\u5230\u5f53\u524d\u7ebf\u7a0b\u6c60\u4e2d\u7ebf\u7a0b\u6570\u91cf\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python \u7ebf\u7a0b\u6c60\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u80fd\u786e\u8ba4\u5230\u5f53\u524d\u7ebf\u7a0b\u6c60\u4e2d\u7ebf\u7a0b\u6570\u91cf\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5982\u9898\uff0c\u60f3\u8981\u8fdb\u884c\u4e00\u4e9b\u538b\u529b\u6d4b\u8bd5\uff0c\u60f3\u83b7\u53d6\u4e00\u4e0b\u7ebf\u7a0b\u6c60\u6570\u91cf\uff0c\u6587\u6863\u91cc\u6ca1\u770b\u5230\u65b9\u6cd5\uff0c\u6709\u4eba\u77e5\u9053\u5417\uff1f<\/p>\n<p>\u5c31\u662f\u4ee5\u4e0b\u7684\u8fd9\u4e2a\u5305<\/p>\n<pre><code>from concurrent.futures import ThreadPoolExecutor  thread_pool = ThreadPoolExecutor() <\/code><\/pre>\n<p>\u6211\u77e5\u9053\u8fd9\u4e2a\u7ebf\u7a0b\u6c60\u5728\u521b\u5efa\u65f6\u53ef\u4ee5\u9650\u5236\u6700\u5927\u7ebf\u7a0b\u6570\u91cf\u3002<\/p>\n<p>\u4f46\u82e5\u4e0d\u9650\u5236\u7684\u8bdd\uff0c\u6211\u60f3\u5c1d\u8bd5\u6700\u5927\u80fd\u8fbe\u5230\u591a\u5c11\uff0c\u4ee5\u53ca\u5728\u591a\u5c11\u7684\u65f6\u5019\u6bd4\u8f83\u7a33\u5b9a\u3002<\/p>\n<p>\u8c22\u8c22<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>1<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4740455\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 111111111111 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             num_threads = len(thread_pool._threads)<\/p>\n<p>https:\/\/github.com\/python\/cpython\/blob\/3.9\/Lib\/concurrent\/futures\/thread.py#L184                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python \u7ebf\u7a0b\u6c60\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u529e&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233222"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233222"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233222\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233222"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}