{"id":2972,"date":"2023-07-14T17:42:20","date_gmt":"2023-07-14T09:42:20","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=2972"},"modified":"2023-07-14T17:42:21","modified_gmt":"2023-07-14T09:42:21","slug":"%e9%9d%a2%e8%af%95%e9%a2%98%e7%b3%bb%e5%88%97%ef%bc%9a%e4%bb%80%e4%b9%88%e6%98%af%e7%ba%bf%e7%a8%8b%e6%b1%a0%ef%bc%9f%e7%ba%bf%e7%a8%8b%e6%b1%a0threadpoolexecutor%e4%bd%bf%e7%94%a8%e5%8f%8a%e5%85%b6","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/%e9%9d%a2%e8%af%95%e9%a2%98%e7%b3%bb%e5%88%97%ef%bc%9a%e4%bb%80%e4%b9%88%e6%98%af%e7%ba%bf%e7%a8%8b%e6%b1%a0%ef%bc%9f%e7%ba%bf%e7%a8%8b%e6%b1%a0threadpoolexecutor%e4%bd%bf%e7%94%a8%e5%8f%8a%e5%85%b6\/","title":{"rendered":"\u9762\u8bd5\u9898\u7cfb\u5217\uff1a\u4ec0\u4e48\u662f\u7ebf\u7a0b\u6c60\uff1f\u7ebf\u7a0b\u6c60ThreadPoolExecutor\u4f7f\u7528\u53ca\u5176\u539f\u7406\u53c8\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\u4f5c\u8005\u5e73\u53f0\uff1a<\/span><\/p>\n<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">| CSDN\uff1ahttps:\/\/blog.csdn.net\/qq_41153943\uff08ID\uff1a\u6c5f\u590f\u3001\uff09<\/span><\/p>\n<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">| \u6398\u91d1\uff1ahttps:\/\/juejin.cn\/user\/651387938290686\uff08<span style=\"outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">ID\uff1a<\/span><\/span><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">jiangxia_1024<\/span><span style=\"outline: 0px; max-width: 100%; font-size: 16px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\uff09<\/span><\/p>\n<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">| \u77e5\u4e4e\uff1ahttps:\/\/www.zhihu.com\/p<\/span><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">eople\/1024-paper-96\uff08<span style=\"outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">ID\uff1a<\/span>\u6c5f\u590f\uff09<\/span><\/p>\n<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">| GitHub\uff1ahttps:\/\/github.com\/JiangXia-1024?tab=repositories<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 12px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">|\u00a0\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a1024\u7b14\u8bb0<\/span><\/span><\/span><\/p>\n<blockquote class=\"js_blockquote_wrap\" style=\"outline: 0px; max-width: 100%; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-type=\"2\" data-url=\"\" data-author-name=\"\" data-content-utf8-length=\"18\" data-source-title=\"\">\n<section class=\"js_blockquote_digest\" style=\"outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\u672c\u6587\u4e00\u51712496\u5b57\uff0c\u9884\u8ba1\u9605\u8bfb15\u5206\u949f<\/section>\n<\/section>\n<\/blockquote>\n<section style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; margin-bottom: 16px; margin-top: 24px; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">1\u3001\u4ec0\u4e48\u662fSynchronized\u548cReentrantLock<\/span><\/section>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"qE5Q7x6W\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">Java\u4e2d\u7684\u7ebf\u7a0b\uff08Thread\uff09\u662f\u6307\u7a0b\u5e8f\u6267\u884c\u7684\u4e00\u4e2a\u8def\u5f84\uff0c\u5b83\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u8fdb\u7a0b\uff0c\u7528\u4e8e\u6267\u884c\u7279\u5b9a\u7684\u4efb\u52a1\u3002\u6bcf\u4e2aJava\u5e94\u7528\u90fd\u81f3\u5c11\u6709\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u5373\u4e3b\u7ebf\u7a0b\uff0c\u5f53Java\u5e94\u7528\u542f\u52a8\u65f6\uff0c\u4e3b\u7ebf\u7a0b\u4f1a\u81ea\u52a8\u5f00\u542f\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"zLwn4_-B\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">Java\u4e2d\u7684\u7ebf\u7a0b\u662f\u901a\u8fc7java.lang.Thread\u7c7b\u6765\u5b9e\u73b0\u7684\u3002\u5728Java\u4e2d\uff0c\u521b\u5efa\u7ebf\u7a0b\u4e3b\u8981\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a<\/span><\/p>\n<h3 style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; margin-bottom: 16px; margin-top: 24px; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-into-catalog-status=\"\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">1. 1\u3001\u7ee7\u627fThread\u7c7b\uff1a<\/span><\/h3>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"74Roh0Pv\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627fThread\u7c7b\u7684\u5b50\u7c7b\uff1b<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"rt1xSJch\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u91cd\u5199Thread\u7c7b\u7684run()\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u662f\u7ebf\u7a0b\u7684\u5165\u53e3\u70b9\uff1b<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"JfDII9-F\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u5b9e\u4f8b\u5316\u8be5\u5b50\u7c7b\uff0c\u5e76\u8c03\u7528start()\u65b9\u6cd5\uff0cstart()\u65b9\u6cd5\u5c06\u542f\u52a8\u65b0\u7684\u7ebf\u7a0b\uff0c\u5e76\u6267\u884crun()\u65b9\u6cd5\u5185\u7684\u4ee3\u7801\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"987hH_yA\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u4f8b\u5982\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code><span class=\"code-snippet_outer\">   <span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">MyThread<\/span> <span class=\"code-snippet__keyword\">extends<\/span> <span class=\"code-snippet__title\">Thread<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">\n       <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n       <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">\n           <span class=\"code-snippet__comment\">\/\/ \u7ebf\u7a0b\u8981\u6267\u884c\u7684\u4ee3\u7801<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n       }<\/span><\/code><code><span class=\"code-snippet_outer\">\n   }<\/span><\/code><code><span class=\"code-snippet_outer\">\n<\/span><\/code><code><span class=\"code-snippet_outer\">   <span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u5e76\u542f\u52a8\u65b0\u7ebf\u7a0b<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n   MyThread thread = <span class=\"code-snippet__keyword\">new<\/span> MyThread();<\/span><\/code><code><span class=\"code-snippet_outer\">\n   thread.start();<\/span><\/code><\/pre>\n<\/section>\n<h3 style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; margin-bottom: 16px; margin-top: 24px; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-into-catalog-status=\"\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">1.2\u3001\u00a0\u5b9e\u73b0Runnable\u63a5\u53e3\uff1a<\/span><\/h3>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"FhXkoP8f\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u5b9a\u4e49\u4e00\u4e2a\u5b9e\u73b0Runnable\u63a5\u53e3\u7684\u7c7b\uff1b<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"yCgEWYXh\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u5b9e\u73b0Runnable\u63a5\u53e3\u4e2d\u7684run()\u65b9\u6cd5\uff1b<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"YYxmoM02\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u521b\u5efa\u8be5\u7c7b\u7684\u5b9e\u4f8b\uff0c\u5e76\u5c06\u5176\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9Thread\u7c7b\u7684\u6784\u9020\u51fd\u6570\uff1b<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"-fLL7R2c\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- \u8c03\u7528start()\u65b9\u6cd5\u6765\u542f\u52a8\u7ebf\u7a0b\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"Pz8O43KF\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u4f8b\u5982\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code><span class=\"code-snippet_outer\">   <span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">MyRunnable<\/span> <span class=\"code-snippet__keyword\">implements<\/span> <span class=\"code-snippet__title\">Runnable<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">\n       <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n       <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">\n           <span class=\"code-snippet__comment\">\/\/ \u7ebf\u7a0b\u8981\u6267\u884c\u7684\u4ee3\u7801<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n       }<\/span><\/code><code><span class=\"code-snippet_outer\">\n   }<\/span><\/code><code><span class=\"code-snippet_outer\">\n   <span class=\"code-snippet__comment\">\/\/ \u521b\u5efaRunnable\u5bf9\u8c61<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n   MyRunnable runnable = <span class=\"code-snippet__keyword\">new<\/span> MyRunnable();<\/span><\/code><code><span class=\"code-snippet_outer\">\n   <span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u5e76\u542f\u52a8\u65b0\u7ebf\u7a0b<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n   Thread thread = <span class=\"code-snippet__keyword\">new<\/span> Thread(runnable);<\/span><\/code><code><span class=\"code-snippet_outer\">\n   thread.start();<\/span><\/code><\/pre>\n<\/section>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"Tr53d7m4\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5728Java\u4e2d\uff0c\u591a\u7ebf\u7a0b\u7684\u4f7f\u7528\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6267\u884c\u6548\u7387\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u4e00\u4e9b\u9700\u8981\u5927\u91cf\u8ba1\u7b97\u6216I\/O\u7b49\u5f85\u7684\u4efb\u52a1\u6765\u8bf4\uff0c\u4f7f\u7528\u591a\u7ebf\u7a0b\u53ef\u4ee5\u5145\u5206\u5229\u7528CPU\u8d44\u6e90\uff0c\u5e76\u63d0\u9ad8\u7a0b\u5e8f\u54cd\u5e94\u901f\u5ea6\u3002<\/span><\/p>\n<h2 style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; margin-bottom: 16px; margin-top: 24px; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-into-catalog-status=\"\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">2\u3001\u7ebf\u7a0b\u6c60<\/span><\/h2>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"ZF1wenJ3\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">Java\u4e2d\u7684\u7ebf\u7a0b\u6c60\u662f\u4e00\u79cd\u53ef\u4ee5\u7ba1\u7406\u548c\u590d\u7528\u591a\u4e2a\u7ebf\u7a0b\u7684\u673a\u5236\u3002\u5b83\u4e3b\u8981\u5305\u542b\u4e24\u4e2a\u7ec4\u4ef6\uff1a\u4efb\u52a1\u961f\u5217\u548c\u7ebf\u7a0b\u6c60\u3002\u4efb\u52a1\u961f\u5217\u7528\u4e8e\u5b58\u50a8\u7b49\u5f85\u6267\u884c\u7684\u4efb\u52a1\uff0c\u800c\u7ebf\u7a0b\u6c60\u5219\u8d1f\u8d23\u4ece\u4efb\u52a1\u961f\u5217\u4e2d\u53d6\u51fa\u4efb\u52a1\uff0c\u521b\u5efa\u7ebf\u7a0b\u5e76\u6267\u884c\u4efb\u52a1\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"my_GSFmV\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5728Java\u4e2d\uff0c\u7ebf\u7a0b\u6c60\u901a\u8fc7 Executor \u6846\u67b6\u63d0\u4f9b\u652f\u6301\u3002Java\u4e2d\u7684Executor\u88ab\u8bbe\u8ba1\u6210\u4e00\u4e2a\u9876\u5c42\u63a5<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u53e3\uff0c\u7528\u4e8e\u5b9e\u73b0\u4e0d\u540c\u7684\u7ebf\u7a0b\u8c03\u5ea6\u7b56\u7565\u3002Executors\u7c7b\u662fExecutor\u6846\u67b6\u7684\u5de5\u5382\u7c7b\uff0c\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u65b9\u4fbf\u5730\u521b\u5efa\u548c\u7ba1\u7406\u7ebf\u7a0b\u6c60\u3002\u5e38\u89c1\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b\u5305\u62ec\uff1a<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"uMuD5O06\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">1. FixedThreadPool\uff1a\u56fa\u5b9a\u5927\u5c0f\u7684\u7ebf\u7a0b\u6c60\uff0c\u7ebf\u7a0b\u6570\u56fa\u5b9a\uff0c\u7ebf\u7a0b\u6c60\u4e2d\u7684\u7ebf\u7a0b\u59cb\u7ec8\u4fdd\u6301\u4e0d\u53d8\u3002\u5982\u679c\u67d0\u4e2a\u4efb\u52a1\u8fdb\u5165\u4efb\u52a1\u961f\u5217\u540e\u65e0\u6cd5\u7acb\u5373\u6267\u884c\uff0c\u5219\u5fc5\u987b\u7b49\u5f85\u5176\u4ed6\u4efb\u52a1\u5b8c\u6210\u540e\u624d\u80fd\u6267\u884c\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"g4KGymJB\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">2. CachedThreadPool\uff1a\u53ef\u7f13\u5b58\u7684\u7ebf\u7a0b\u6c60\uff0c\u6839\u636e\u9700\u8981\u521b\u5efa\u65b0\u7ebf\u7a0b\uff0c\u4f46\u5728\u6709\u7a7a\u95f2\u7ebf\u7a0b\u65f6\u4f1a\u91cd\u7528\u5148\u524d\u6784\u5efa\u7684\u7ebf\u7a0b\u3002\u5f53\u7ebf\u7a0b\u6c60\u4e2d\u7684\u7ebf\u7a0b\u957f\u65f6\u95f4\u672a\u4f7f\u7528\u4e14\u6ee1\u8db3\u56de\u6536\u6761\u4ef6\u65f6\uff08JVM\u4f1a\u81ea\u52a8\u5224\u65ad\uff09\uff0c\u4f1a\u88ab\u79fb\u51fa\u7ebf\u7a0b\u6c60\uff0c\u76f4\u5230\u4e0b\u6b21\u6709\u4efb\u52a1\u9700\u8981\u6267\u884c\u65f6\u518d\u91cd\u65b0\u521b\u5efa\u65b0\u7ebf\u7a0b\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"WP3UXwdT\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">3. SingleThreadExecutor\uff1a<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5355\u4e00\u7ebf\u7a0b\u7ebf\u7a0b\u6c60<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\uff0c\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u5728\u5de5\u4f5c\uff0c\u9010\u4e2a\u6267\u884c\u4efb\u52a1\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"k4_qyg7D\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">4. ScheduledThreadPool\uff1a\u5177\u6709\u5b9a\u671f\u6267\u884c\u4efb\u52a1\u548c\u5ef6\u8fdf\u6267\u884c\u4efb\u52a1\u7684\u56fa\u5b9a\u7ebf\u7a0b\u6c60<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5927\u5c0f\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"U5C8cbXP\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">Java \u4e2d\u4f7f\u7528\u7ebf\u7a0b\u6c60\u7684\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u56fa\u5b9a\u5927\u5c0f\u7684\u7ebf\u7a0b\u6c60<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nExecutorService executor = Executors.newFixedThreadPool(<span class=\"code-snippet__number\">10<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\n\/\/ \u521b\u5efa\u4e00\u4e2a\u9700\u8981\u6267\u884c\u7684\u4efb\u52a1<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nRunnable task = <span class=\"code-snippet__keyword\">new<\/span> Runnable() {<\/span><\/code><code><span class=\"code-snippet_outer\">\n   @<span class=\"code-snippet__function\">Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet_outer\">\n   <span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span>()<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">\n      <span class=\"code-snippet__comment\">\/\/ \u6267\u884c\u4e00\u4e9b\u64cd\u4f5c\uff0c\u4f8b\u5982\u8f93\u51fa\u5f53\u524d\u7ebf\u7a0b\u540d\u5b57<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n      System.<span class=\"code-snippet__keyword\">out<\/span>.println(<span class=\"code-snippet__string\">\"\u5f53\u524d\u7ebf\u7a0b\uff1a\"<\/span> + Thread.currentThread().getName());<\/span><\/code><code><span class=\"code-snippet_outer\">\n   }<\/span><\/code><code><span class=\"code-snippet_outer\">\n};<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\n\/\/ \u63d0\u4ea4\u4efb\u52a1\u5230\u7ebf\u7a0b\u6c60\u4e2d<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nexecutor.submit(task);<\/span><\/code><code><span class=\"code-snippet_outer\">\n<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u6700\u540e\u5173\u95ed\u7ebf\u7a0b\u6c60<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nexecutor.shutdown();<\/span><\/code><\/pre>\n<\/section>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"p5ZA41yo\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u9996\u5148\u4f7f\u7528Executors.newFixedThreadPool()\u65b9\u6cd5\u521b\u5efa\u4e86\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u4e3a 10 \u7684\u7ebf\u7a0b\u6c60\u3002\u7136\u540e\u521b\u5efa\u4e86\u4e00\u4e2a\u9700\u8981\u6267\u884c\u7684\u4efb\u52a1\uff0c\u5b83\u4f1a\u8f93\u51fa\u5f53\u524d\u7ebf\u7a0b\u540d\u5b57\u3002\u63a5\u7740\u901a\u8fc7executor.submit()\u65b9\u6cd5\u5c06\u4efb\u52a1\u63d0\u4ea4\u7ed9\u7ebf\u7a0b\u6c60\u5904\u7406\u3002\u6700\u540e\uff0c\u4f7f\u7528 executor.shutdown()\u65b9\u6cd5\u5173\u95ed\u7ebf\u7a0b\u6c60\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"1AttxxnE\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u4f7f\u7528\u7ebf\u7a0b\u6c60\u53ef\u4ee5\u907f\u514d\u91cd\u590d\u521b\u5efa\u3001\u9500\u6bc1\u7ebf\u7a0b\u7684\u5f00\u9500\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u540c\u65f6\uff0c\u7ebf\u7a0b\u6c60\u8fd8\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u63a7\u5236\u5e76\u53d1\u5ea6\uff0c\u9632\u6b62\u7531\u4e8e\u7ebf\u7a0b\u6570\u91cf\u8fc7\u591a\u800c\u9020\u6210\u7cfb\u7edf\u8d1f\u8f7d\u8fc7\u9ad8\u7684\u95ee\u9898\u3002\u7ebf\u7a0b\u6c60\u4e5f\u53ef\u4ee5\u7075\u6d3b\u5730\u914d\u7f6e\u4e00\u4e9b\u53c2\u6570\uff0c\u4f8b\u5982\u7ebf\u7a0b\u6570\u3001\u7ebf\u7a0b\u8d85\u65f6\u65f6\u95f4\u7b49\uff0c\u4ee5\u6700\u5927\u9650\u5ea6\u5730\u6ee1\u8db3\u5e94\u7528\u7a0b\u5e8f\u5bf9\u7ebf\u7a0b\u5904\u7406\u7684\u7ba1\u7406\u9700\u6c42\u3002<\/span><\/p>\n<h2 style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; margin-bottom: 16px; margin-top: 24px; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-into-catalog-status=\"\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">3\u3001\u7ebf\u7a0b\u6c60ThreadPoolExecutor\u539f\u7406<\/span><\/h2>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"Q6TMXnju\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">Java\u4e2d\u7684\u7ebf\u7a0b\u6c60\u662f\u901a\u8fc7 Executor \u6846\u67b6\u63d0\u4f9b\u652f\u6301\u7684\uff0c\u5176\u4e2d ThreadPoolExecutor \u662f Executor \u7684\u4e00\u4e2a\u5b9e\u73b0\u7c7b\u3002ThreadPoolExecutor \u53ef\u4ee5\u66f4\u52a0\u7075\u6d3b\u5730\u914d\u7f6e\u7ebf\u7a0b\u6c60\u7684\u53c2\u6570\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"3Q2goVcx\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">ThreadPoolExecutor \u4e3b\u8981\u6709\u4e0b\u9762\u51e0\u4e2a\u6784\u9020\u65b9\u6cd5\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\">ThreadPoolExecutor(<span class=\"code-snippet__keyword\">int<\/span> corePoolSize, <span class=\"code-snippet__keyword\">int<\/span> maximumPoolSize, <span class=\"code-snippet__keyword\">long<\/span> keepAliveTime, TimeUnit unit, BlockingQueue&lt;Runnable&gt; workQueue)<\/span><\/code><code><span class=\"code-snippet_outer\">\nThreadPoolExecutor(<span class=\"code-snippet__keyword\">int<\/span> corePoolSize, <span class=\"code-snippet__keyword\">int<\/span> maximumPoolSize, <span class=\"code-snippet__keyword\">long<\/span> keepAliveTime, TimeUnit unit, BlockingQueue&lt;Runnable&gt; workQueue, RejectedExecutionHandler handler)<\/span><\/code><code><span class=\"code-snippet_outer\">\nThreadPoolExecutor(<span class=\"code-snippet__keyword\">int<\/span> corePoolSize, <span class=\"code-snippet__keyword\">int<\/span> maximumPoolSize, <span class=\"code-snippet__keyword\">long<\/span> keepAliveTime, TimeUnit unit, BlockingQueue&lt;Runnable&gt; workQueue, ThreadFactory threadFactory)<\/span><\/code><code><span class=\"code-snippet_outer\">\nThreadPoolExecutor(<span class=\"code-snippet__keyword\">int<\/span> corePoolSize, <span class=\"code-snippet__keyword\">int<\/span> maximumPoolSize, <span class=\"code-snippet__keyword\">long<\/span> keepAliveTime, TimeUnit unit, BlockingQueue&lt;Runnable&gt; workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"3pe3oJhV\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5b83\u4eec\u90fd\u5177\u6709\u76f8\u540c\u7684\u6838\u5fc3\u53c2\u6570\uff1a<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"vRWi63vc\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- corePoolSize\uff1a\u6838\u5fc3\u7ebf\u7a0b\u6570\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"25u5pXmZ\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- maximumPoolSize\uff1a\u7ebf\u7a0b\u6c60\u6700\u5927\u540c\u65f6\u6267\u884c\u7684\u7ebf\u7a0b\u6570\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"2vAATe3J\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- keepAliveTime\uff1a\u7a7a\u95f2\u7ebf\u7a0b\u7b49\u5f85\u65b0\u4efb\u52a1\u7684\u6700\u957f\u65f6\u95f4\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"SecKDzBv\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- unit\uff1akeepAliveTime \u53c2\u6570\u7684\u65f6\u95f4\u5355\u4f4d\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"ahg3Ov1Q\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- workQueue\uff1a\u963b\u585e\u961f\u5217\uff0c\u7528\u4e8e\u5b58\u50a8\u5f85\u6267\u884c\u7684\u4efb\u52a1\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"Ui24wOE8\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- threadFactory\uff1a\u7ebf\u7a0b\u5de5\u5382\uff0c\u7528\u4e8e\u521b\u5efa\u7ebf\u7a0b\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"r1XB-zlF\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">- handler\uff1a\u62d2\u7edd\u7b56\u7565\uff0c\u7528\u4e8e\u5904\u7406\u65b0\u4efb\u52a1\u63d0\u4ea4\u65f6\u65e0\u6cd5\u6dfb\u52a0\u5230\u963b\u585e\u961f\u5217\u4e2d\u7684\u60c5\u51b5\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"F-nehkFo\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">ThreadPoolExecutor \u63a7\u5236\u7740\u591a\u4e2a\u5e76\u53d1\u6267\u884c\u7684\u4efb\u52a1\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e2a\u7ebf\u7a0b\u6c60\u5206\u6210\u4e09\u90e8\u5206\uff1a<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"XMhDx5bM\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">1. \u4efb\u52a1\u961f\u5217\u3002\u5f53\u7ebf\u7a0b\u6c60\u4e2d\u6240\u6709\u7684\u7ebf\u7a0b\u5747\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u65f6\uff0c\u65b0\u4efb\u52a1\u5c06\u4f1a\u5728\u4efb\u52a1\u961f\u5217\u4e2d\u7b49\u5f85\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"Z0fsReK-\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">2. \u7ebf\u7a0b\u6c60\u672c\u8eab\u3002ThreadPoolExecutor \u5b9e\u4f8b\u7ef4\u62a4\u7740\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u7ebf\u7a0b\u6570\uff0c\u8fd9\u4e9b\u7ebf\u7a0b\u5df2\u7ecf\u88ab\u521b\u5efa\u51fa\u6765\u5e76\u4e14\u51c6\u5907\u597d\u63a5\u53d7\u65b0\u7684\u4efb\u52a1\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"RR-j2rG2\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">3. \u4efb\u52a1\u62d2\u7edd\u5904\u7406\u5668\u3002\u5f53\u4efb\u52a1\u4e0d\u80fd\u88ab\u6dfb\u52a0\u5230\u7ebf\u7a0b\u6c60\u6216\u6267\u884c\u961f\u5217\u4e2d\u65f6\uff0c\u5c06\u7531\u4efb\u52a1\u62d2\u7edd\u5904\u7406\u5668\u8fdb\u884c\u5904\u7406\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"hYLU7Uhv\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">ThreadPoolExecutor \u7684\u539f\u7406\u662f\uff1a\u901a\u8fc7\u914d\u7f6e\u4e00\u4e9b\u53c2\u6570\uff0c\u53ef\u4ee5\u7075\u6d3b\u63a7\u5236\u7ebf\u7a0b\u6c60\u4e2d\u7684\u7ebf\u7a0b\u6570\u91cf\u3001\u4efb\u52a1\u961f\u5217\u5bb9\u91cf\u4ee5\u53ca\u4f55\u65f6\u521b\u5efa\u548c\u9500\u6bc1\u7ebf\u7a0b\u7b49\u64cd\u4f5c\uff0c\u907f\u514d\u4e86\u9891\u7e41\u5730\u521b\u5efa\u3001\u9500\u6bc1\u7ebf\u7a0b\u5e26\u6765\u7684\u6027\u80fd\u635f\u5931\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u597d\u5730\u7ba1\u7406\u7ebf\u7a0b\u7684\u5f00\u9500\u548c\u65f6\u95f4\uff0c\u8fbe\u5230\u63d0\u9ad8\u7a0b\u5e8f\u6027\u80fd\u548c\u53ef\u7ef4\u62a4\u6027\u7684\u76ee\u7684\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"sBHvr6KP\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u4e0b\u9762\u662f ThreadPoolExecutor \u7684\u4f7f\u7528\u793a\u4f8b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u4e3a10\u7684\u7ebf\u7a0b\u6c60<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nThreadPoolExecutor executor = <span class=\"code-snippet__keyword\">new<\/span> ThreadPoolExecutor(<\/span><\/code><code><span class=\"code-snippet_outer\">\n        <span class=\"code-snippet__number\">10<\/span>, <span class=\"code-snippet__comment\">\/\/ \u6838\u5fc3\u7ebf\u7a0b\u6c60\u5927\u5c0f<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n        <span class=\"code-snippet__number\">20<\/span>, <span class=\"code-snippet__comment\">\/\/ \u6700\u591a\u5141\u8bb820\u4e2a\u7ebf\u7a0b\u540c\u65f6\u6267\u884c<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n        <span class=\"code-snippet__number\">60L<\/span>, <span class=\"code-snippet__comment\">\/\/ \u7a7a\u95f2\u7ebf\u7a0b\u7b49\u5f85\u65b0\u4efb\u52a1\u7684\u6700\u957f\u65f6\u95f4<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n        TimeUnit.SECONDS, <span class=\"code-snippet__comment\">\/\/ \u65f6\u95f4\u5355\u4f4d\uff08\u79d2\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n        <span class=\"code-snippet__keyword\">new<\/span> ArrayBlockingQueue&lt;&gt;(<span class=\"code-snippet__number\">1000<\/span>), <span class=\"code-snippet__comment\">\/\/ \u7b49\u5f85\u961f\u5217\uff08\u5bb9\u91cf\u4e3a1000\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n        <span class=\"code-snippet__keyword\">new<\/span> ThreadPoolExecutor.CallerRunsPolicy() <span class=\"code-snippet__comment\">\/\/ \u62d2\u7edd\u7b56\u7565\uff1a\u8c03\u7528\u8005\u8fd0\u884c\u7b56\u7565<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\n);<\/span><\/code><code><span class=\"code-snippet_outer\">\n<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u63d0\u4ea4\u4efb\u52a1\u5230\u7ebf\u7a0b\u6c60\u4e2d<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nexecutor.submit(() -&gt; {<\/span><\/code><code><span class=\"code-snippet_outer\">\n    <span class=\"code-snippet__keyword\">try<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">\n        Thread.sleep(<span class=\"code-snippet__number\">1000<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">\n        System.<span class=\"code-snippet__keyword\">out<\/span>.println(<span class=\"code-snippet__string\">\"Hello, world!\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">\n    } <span class=\"code-snippet__keyword\">catch<\/span> (InterruptedException e) {<\/span><\/code><code><span class=\"code-snippet_outer\">\n        e.printStackTrace();<\/span><\/code><code><span class=\"code-snippet_outer\">\n    }<\/span><\/code><code><span class=\"code-snippet_outer\">\n});<\/span><\/code><code><span class=\"code-snippet_outer\">\n<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u5173\u95ed\u7ebf\u7a0b\u6c60<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">\nexecutor.shutdown();<\/span><\/code><\/pre>\n<\/section>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"uCYwMxuh\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u9996\u5148\u901a\u8fc7\u6784\u9020\u65b9\u6cd5\u521b\u5efa\u4e86\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u4e3a 10 \u7684\u7ebf\u7a0b\u6c60executor\uff0c\u5b83\u6700\u591a\u5141\u8bb8 20 \u4e2a\u7ebf\u7a0b\u540c\u65f6\u6267\u884c\uff0c\u5e76\u4e14\u7a7a\u95f2\u7ebf\u7a0b\u7b49\u5f85\u65b0\u4efb\u52a1\u7684\u6700\u957f\u65f6\u95f4\u4e3a 60 \u79d2\u3002\u4efb\u52a1\u961f\u5217\u662f\u4e00\u4e2a\u5bb9\u91cf\u4e3a 1000 \u7684\u6709\u754c\u963b\u585e\u961f\u5217\u3002\u62d2\u7edd\u7b56\u7565\u91c7\u7528\u4e86CallerRunsPolicy\uff0c\u5f53\u7ebf\u7a0b\u6c60\u65e0\u6cd5\u5904\u7406\u65b0\u4efb\u52a1\u65f6\uff0c\u4f1a\u7531\u63d0\u4ea4\u8be5\u4efb\u52a1\u7684\u4e3b\u7ebf\u7a0b\u76f4\u63a5\u8fd0\u884c\u4efb\u52a1\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"qRjTFcyr\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u63a5\u7740\uff0c\u901a\u8fc7executor.submit()\u65b9\u6cd5\u63d0\u4ea4\u4e86\u4e00\u4e2a\u4efb\u52a1\u5230\u7ebf\u7a0b\u6c60\u4e2d\u3002\u8fd9\u4e2a\u4efb\u52a1\u4f1a\u7761\u7720 1 \u79d2\u5e76\u8f93\u51fa \"Hello, world!\"\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"gtG0DteL\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u6700\u540e\uff0c\u901a\u8fc7executor.shutdown()\u65b9\u6cd5\u5173\u95ed\u4e86\u7ebf\u7a0b\u6c60\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"LYLR2Kbn\"><span style=\"font-weight: bolder; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">4\u3001<\/span><span style=\"font-size: 14px; letter-spacing: 0.544px;\"><span style=\"outline: 0px; font-weight: bolder; max-width: 100%; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #0080ff; text-align: left; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; font-size: 14px; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\u603b\u7ed3<\/span><\/span><\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"LYLR2Kbn\"><span style=\"font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; letter-spacing: 0.544px; background-color: #ffffff;\">\u5728\u4f7f\u7528\u7ebf\u7a0b\u6c60\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u4e1a\u52a1\u573a\u666f\u9009\u62e9\u5408\u9002\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b\u548c\u53c2\u6570\uff0c\u4ee5\u8fbe\u5230\u66f4\u597d\u5730\u63a7\u5236\u5e76\u53d1\u5ea6\u3001\u63d0\u9ad8\u7a0b\u5e8f\u6027\u80fd\u7b49\u76ee\u7684\u3002<\/span><\/p>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"LYLR2Kbn\"><span style=\"font-size: 14px; letter-spacing: 0.544px;\">\u6700\u540e\u611f\u8c22\u5927\u5bb6\u7684\u5173\u6ce8\uff01<\/span><\/p>\n<p style=\"text-align: center; margin-bottom: 0px;\"><span style=\"color: #d6d6d6; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 14px; letter-spacing: 2px; text-align: center; word-spacing: 2px; background-color: #ffffff;\">-END-<\/span><\/p>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<p style=\"margin-bottom: 0px;\">\n<section style=\"margin-bottom: 0px; outline: 0px; max-width: 100%; letter-spacing: 0.544px; white-space: normal; color: #3e3e3e; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 16px; font-weight: bold; text-align: left; widows: 1; word-spacing: 2px; caret-color: #ff0000; background-color: #ffffff; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"outline: 0px; max-width: 100%; color: #ff2941; letter-spacing: 2px; font-size: 14px; font-family: Optima-Regular, PingFangTC-light; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\u76f8\u5173\u63a8\u8350\uff1a<\/span><\/section>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 1.2em; outline: 0px; max-width: 100%; letter-spacing: 0.544px; white-space: normal; color: #3e3e3e; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 16px; font-weight: bold; text-align: left; widows: 1; word-spacing: 2px; caret-color: #ff0000; background-color: #ffffff; list-style-type: circle; overflow-wrap: break-word !important;\">\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493096&amp;idx=1&amp;sn=8dbe7f1f65a23ed3522070ca772430d8&amp;chksm=fa1aaa94cd6d2382c47e52a2d41f97887e59d256877b003a967976595a923bf17dc4f6de9375&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1aOpenFeign\u7ec4\u4ef6<\/a><br \/>\n<br style=\"outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\" \/><br \/>\n<\/section>\n<\/li>\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493241&amp;idx=1&amp;sn=4fcca6175db136f515b3ffd89bcea557&amp;chksm=fa1aa905cd6d20133e3f45812670cd240698e23ad4cdf6b12ecadc4ea686538247aa1ce21d04&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u5982\u4f55\u4f7f\u7528JWT\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1<\/a><br \/>\n<br style=\"outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\" \/><br \/>\n<\/section>\n<\/li>\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493301&amp;idx=1&amp;sn=edb58ba9e8bc9127df1dbe7881ee3784&amp;chksm=fa1aa9c9cd6d20df23953579d102b91e7a2a87ad1d7c66735f2c2cd46a5be8c7b72d0e4fe5a4&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u96ea\u5d29\u3001\u670d\u52a1\u7194\u65ad\u3001\u670d\u52a1\u964d\u7ea7<\/a><br \/>\n<br style=\"outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\" \/><br \/>\n<\/section>\n<\/li>\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493338&amp;idx=1&amp;sn=9a4da5136fdf1525676a9a106f23ea39&amp;chksm=fa1aa9a6cd6d20b0e68f5c046b242897bea07ff692f4359f842890eb6c2c58e8650d3c9ad6de&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1aHystrix Dashboard\u7684\u7b80\u5355\u4f7f\u7528<\/a><br \/>\n<br style=\"outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\" \/><br \/>\n<\/section>\n<\/li>\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493363&amp;idx=1&amp;sn=38e0cf9f1452d38415c4461cfaa11d4e&amp;chksm=fa1aa98fcd6d20995dcc85309ff0b02932afb2abd995143f44e0bd11ec19a2fc9b23f9ce32f1&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0b\uff09<\/a><\/p>\n<\/section>\n<\/li>\n<li style=\"outline: 0px; max-width: 100%; font-size: 14px; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px; max-width: 100%; line-height: 2em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493350&amp;idx=1&amp;sn=815bd29cbf8e432cf8f6effafadcba68&amp;chksm=fa1aa99acd6d208c41dd027f7033c932017a470e7f7f01dc68eb624c2af53646608f6437bf4e&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0a\uff09<\/a><\/section>\n<\/li>\n<\/ul>\n<p style=\"outline: 0px; max-width: 100%; color: rgba(0, 0, 0, 0.9); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;\" data-pid=\"LYLR2Kbn\">\n<section style=\"margin-bottom: 0px;\" data-mpa-template=\"t\">\n<section data-id=\"94711\">\n<section style=\"width: 100%; text-align: right;\" data-width=\"100%\">\n<section style=\"display: inline-block;\">\n<section style=\"padding: 6px 12px 10px 14px; background-image: url('https:\/\/mmbiz.qpic.cn\/mmbiz_png\/b96CibCt70iaaBAicDNCSs6H0O0SBGSALfnl7BCsBU1noJP2AdKCs9ibu0ekH61eCzETvxANJYdHfzsrcam7O1tLNg\/640?wx_fmt=png'); background-repeat: no-repeat; text-align: center; background-size: 100% 100%; font-size: 14px; letter-spacing: 2px;\" data-brushtype=\"text\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6211\u5c31\u77e5\u9053\u4f60\u5728\u770b\uff01<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"display: none;\">\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4f5c\u8005\uff1a\u539f\u521b \u6c5f\u590f<\/p>\n<p>\u8f6c\u8f7d\u5730\u5740\uff1ahttps:\/\/mp.weixin.qq.com\/s\/4qqvrta3h61RZ7zp1voIOQ<\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\u5e73\u53f0\uff1a | CSDN\uff1ahttps:\/\/blog.csdn.net\/qq_41153943\uff08ID\uff1a\u6c5f\u590f\u3001\uff09 | \u6398\u91d1\uff1ahttps &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-2972","post","type-post","status-publish","format-standard","hentry","category-java"],"post_thumbnail_image":"","content_first_image":null,"post_medium_image_300":"","post_thumbnail_image_624":"","post_frist_image":null,"post_medium_image":"","post_large_image":"","post_full_image":"","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2023-07-14","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":254,"next_post_id":2998,"next_post_title":"\u9762\u8bd5\u5b98\u75af\u4e86\uff1awhile(true)\u548cfor(;;)\u54ea\u4e2a\u6027\u80fd\u597d\uff1f","previous_post_id":2965,"previous_post_title":"\u770b\u5230\u6700\u540e\uff0c\u4f60\u624d\u53d1\u73b0JAVA\u4e2d\u6ce8\u89e3\u539f\u6765\u662f\u8fd9\u4e48\u505a\u5230\u7684\uff01","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2972"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2972\/revisions"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}