{"id":250,"date":"2026-09-06T00:44:06","date_gmt":"2026-09-05T16:44:06","guid":{"rendered":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-arkts-concurrency\/"},"modified":"2026-09-06T00:44:06","modified_gmt":"2026-09-05T16:44:06","slug":"interview-arkts-concurrency","status":"publish","type":"post","link":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-arkts-concurrency\/","title":{"rendered":"\u9e3f\u8499 ArkTS \u9762\u8bd5 25 \u95ee\uff1a\u8bed\u8a00\u7ea6\u675f\u3001\u7c7b\u578b\u7cfb\u7edf\u4e0e\u5e76\u53d1\u6a21\u578b"},"content":{"rendered":"<div style=\"font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif;font-size:16.5px;line-height:1.9;color:#35435c;letter-spacing:.2px\">\n<div style=\"background:linear-gradient(135deg,#f5f9ff,#eef5ff);border:1px solid #dce8f8;border-left:4px solid #d94f5c;border-radius:12px;padding:16px 20px;margin:0 0 24px;font-size:14.5px;color:#3d5570;line-height:2\"><span style=\"display:inline-block;background:#d94f5c;color:#fff;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:6px;margin-right:12px;letter-spacing:1px;vertical-align:1px\">\u5173\u952e\u8bcd<\/span>\u9e3f\u8499\u9762\u8bd5\u9898\u3001ArkTS\u3001TaskPool\u3001Worker\u3001\u5e76\u53d1\u6a21\u578b\u3001ArkUI \u72b6\u6001\u7ba1\u7406<\/div>\n<div style=\"background:#fafbfd;border:1px solid #e8edf5;border-radius:12px;padding:18px 22px;margin:0 0 30px\">\n<div style=\"font-size:13.5px;font-weight:700;color:#8a99ae;letter-spacing:2px;margin-bottom:12px\">\u76ee\u5f55<\/div>\n<ol style=\"margin:0;padding-left:20px\">\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-1\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e00\u3001ArkTS \u4e0e TypeScript\uff1a\u5230\u5e95\u5dee\u5728\u54ea<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-2\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e8c\u3001\u7c7b\u578b\u7cfb\u7edf\uff1a\u540d\u4e49\u7c7b\u578b\u662f\u6838\u5fc3\u5dee\u5f02<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-3\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e09\u3001\u5e76\u53d1\u6a21\u578b\uff1a\u9e3f\u8499\u9762\u8bd5\u7684\u6838\u5fc3\u533a<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-4\" style=\"color:#42546e;text-decoration:none;border:none\">\u56db\u3001\u72b6\u6001\u7ba1\u7406\u4e0e\u6e32\u67d3\uff1a\u5e38\u89c1\u7684\u8fde\u73af\u8ffd\u95ee<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-5\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e94\u3001\u5e38\u89c1\u8e29\u5751\u6e05\u5355<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-6\" style=\"color:#42546e;text-decoration:none;border:none\">\u516d\u3001\u5c0f\u7ed3<\/a><\/li>\n<\/ol>\n<\/div>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><span style=\"font-size:17px;color:#1e2f47\">\u9e3f\u8499\u9762\u8bd5\u9898\u91cc\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">ArkTS \u8bed\u8a00\u7279\u6027\u4e0e\u5e76\u53d1\u6a21\u578b<\/strong>\u662f\u6700\u80fd\u533a\u5206&#8221;\u5199\u8fc7 Demo&#8221;\u548c&#8221;\u505a\u8fc7\u9879\u76ee&#8221;\u7684\u4e00\u5757\u3002\u539f\u56e0\u5f88\u7b80\u5355\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">ArkTS \u4e0d\u662f TypeScript<\/strong>\uff0c\u5b83\u5728 TS \u7684\u57fa\u7840\u4e0a\u52a0\u4e86\u9759\u6001\u7ea6\u675f\uff1b\u800c\u9e3f\u8499\u7684\u5e76\u53d1\u6a21\u578b\uff08TaskPool \/ Worker\uff09\u548c\u4f20\u7edf\u7ebf\u7a0b\u6a21\u578b\u5dee\u5f02\u660e\u663e\uff0c\u5f88\u591a\u4eba\u53ea\u4f1a\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">async\/await<\/code>\uff0c\u4e00\u95ee\u5230\u8de8\u7ebf\u7a0b\u6570\u636e\u4f20\u9012\u5c31\u7b54\u4e0d\u4e0a\u6765\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u672c\u6587\u6309<strong style=\"color:#0f1c2e;font-weight:600\">\u8bed\u8a00\u7ea6\u675f \u2192 \u7c7b\u578b\u7cfb\u7edf \u2192 \u5e76\u53d1\u6a21\u578b \u2192 \u7ebf\u7a0b\u901a\u4fe1 \u2192 \u5e38\u89c1\u5751<\/strong>\u7ec4\u7ec7\uff0c\u6bcf\u9898\u7ed9\u51fa\u53ef\u76f4\u63a5\u53e3\u8ff0\u7684\u7b54\u6848\u3002<\/p>\n<figure style=\"margin:30px 0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"900\" src=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig.png\" alt=\"\u4e09\u79cd\u5e76\u53d1\u80fd\u529b\u600e\u4e48\u9009\" class=\"wp-image-249\" style=\"max-width:100%;height:auto;border-radius:12px;border:1px solid #e6ecf4;box-shadow:0 8px 24px rgba(15,30,60,.07)\" srcset=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig.png 1200w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig-300x225.png 300w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig-1024x768.png 1024w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig-768x576.png 768w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-arkts-concurrency-fig-800x600.png 800w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><figcaption style=\"margin-top:12px;font-size:13.5px;color:#7b8aa0;text-align:center;line-height:1.75\">Promise \/ TaskPool \/ Worker \u4e0e\u5171\u4eab\u5185\u5b58\u7684\u80fd\u529b\u5b9a\u4f4d\u5bf9\u6bd4<\/figcaption><\/figure>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-1\">\u4e00\u3001ArkTS \u4e0e TypeScript\uff1a\u5230\u5e95\u5dee\u5728\u54ea<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q1\uff1aArkTS \u662f TypeScript \u7684\u8d85\u96c6\u8fd8\u662f\u5b50\u96c6\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e25\u683c\u8bf4\u662f&#8221;\u53d7\u9650\u5b50\u96c6 + \u6269\u5c55&#8221;<\/strong>\u3002ArkTS \u57fa\u4e8e TypeScript \u8bed\u6cd5\uff0c\u4f46<strong style=\"color:#0f1c2e;font-weight:600\">\u4e3b\u52a8\u780d\u6389\u4e86\u4e00\u90e8\u5206\u52a8\u6001\u7279\u6027<\/strong>\uff0c\u540c\u65f6<strong style=\"color:#0f1c2e;font-weight:600\">\u589e\u52a0\u4e86\u81ea\u5df1\u7684\u8bed\u6cd5\uff08\u88c5\u9970\u5668\u3001ArkUI \u58f0\u660e\u5f0f\u63cf\u8ff0\uff09<\/strong>\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u88ab\u9650\u5236\u7684\u6838\u5fc3\u539f\u56e0\u53ea\u6709\u4e00\u4e2a\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u4e3a\u4e86\u5728\u7f16\u8bd1\u671f\u8fdb\u884c\u66f4\u6fc0\u8fdb\u7684\u4f18\u5316\uff0c\u5e76\u4fdd\u8bc1\u8fd0\u884c\u65f6\u884c\u4e3a\u53ef\u9884\u6d4b<\/strong>\u3002ArkTS \u7684\u7f16\u8bd1\u76ee\u6807\u662f\u786e\u5b9a\u6027\u5f3a\u3001\u6027\u80fd\u53ef\u9884\u671f\u7684\u8fd0\u884c\u73af\u5883\uff0c\u52a8\u6001\u7279\u6027\u4f1a\u8ba9\u8fd9\u4e9b\u4f18\u5316\u5931\u6548\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q2\uff1a\u5177\u4f53\u54ea\u4e9b TS \u7279\u6027\u5728 ArkTS \u91cc\u4e0d\u80fd\u7528\uff1f<\/h3>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;border:1px solid #e3eaf3;border-radius:10px;overflow:hidden\">\n<thead>\n<tr>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u53d7\u9650\u7279\u6027<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u5178\u578b\u5199\u6cd5<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">ArkTS \u7684\u5904\u7406<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u52a8\u6001\u589e\u5220\u5c5e\u6027<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">obj.newProp = 1<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7981\u6b62<\/strong>\uff0c\u5bf9\u8c61\u7ed3\u6784\u987b\u5728\u5b9a\u4e49\u65f6\u786e\u5b9a<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7ed3\u6784\u5316\u7c7b\u578b\uff08\u9e2d\u5b50\u7c7b\u578b\uff09<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u9690\u5f0f\u7ed3\u6784\u517c\u5bb9<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u91c7\u7528\u540d\u4e49\u7c7b\u578b<\/strong>\uff0c\u9700\u663e\u5f0f\u58f0\u660e\u7c7b\u578b\u5173\u7cfb<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">any<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">unknown<\/code> \u6ee5\u7528<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">let x: any<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u63a8\u8350 \/ \u53d7\u9650<\/strong>\uff0c\u9700\u663e\u5f0f\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u8fd0\u884c\u671f\u4fee\u6539\u5bf9\u8c61\u5e03\u5c40<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">delete obj.a<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7981\u6b62<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u90e8\u5206\u9ad8\u7ea7\u7c7b\u578b\u4f53\u64cd<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u6761\u4ef6\u7c7b\u578b\u3001\u6620\u5c04\u7c7b\u578b\u7b49<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u652f\u6301\u6709\u9650\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u590d\u6742\u7c7b\u578b\u8fd0\u7b97\u4e0d\u4fdd\u8bc1<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #d94f5c;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u9ad8\u5206\u8868\u8ff0\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;ArkTS \u7528&#8217;\u727a\u7272\u4e00\u90e8\u5206 TS \u7684\u52a8\u6001\u7075\u6d3b\u6027&#8217;\uff0c\u6362\u53d6\u4e86&#8217;\u7f16\u8bd1\u671f\u53ef\u786e\u5b9a\u7684\u5bf9\u8c61\u5e03\u5c40&#8217;\u3002&#8221;<\/strong>\u8fd9\u53e5\u8bdd\u80fd\u89e3\u91ca\u540e\u9762\u51e0\u4e4e\u6240\u6709\u8bed\u6cd5\u9650\u5236\u2014\u2014\u5305\u62ec\u4e3a\u4ec0\u4e48\u5fc5\u987b\u7ed9\u5c5e\u6027\u521d\u59cb\u503c\u3001\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u52a8\u6001\u52a0\u5b57\u6bb5\u3002<\/p>\n<\/blockquote>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q3\uff1a\u4e3a\u4ec0\u4e48 ArkTS \u8981\u6c42\u5c5e\u6027\u5fc5\u987b\u6709\u521d\u59cb\u503c\u6216\u660e\u786e\u53ef\u9009\uff1f<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u4e0d\u5408\u89c4\uff1a\u5c5e\u6027\u672a\u521d\u59cb\u5316\u4e14\u672a\u6807\u8bb0\u53ef\u9009\nclass User {\n  name: string        \/\/ \u62a5\u9519\uff1a\u5fc5\u987b\u521d\u59cb\u5316\u6216\u6807\u8bb0 ?\n}\n\n\/\/ \u5408\u89c4\u5199\u6cd5\nclass User {\n  name: string = ''                 \/\/ \u7ed9\u9ed8\u8ba4\u503c\n  age?: number                      \/\/ \u660e\u786e\u53ef\u9009\n  readonly id: string               \/\/ \u6784\u9020\u51fd\u6570\u4e2d\u8d4b\u503c\n  constructor(id: string) { this.id = id }\n}<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u539f\u56e0\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u7f16\u8bd1\u5668\u9700\u8981\u4e3a\u6bcf\u4e2a\u7c7b\u751f\u6210\u56fa\u5b9a\u7684\u5bf9\u8c61\u5e03\u5c40\uff08\u9690\u85cf\u7c7b\uff09<\/strong>\u3002\u5982\u679c\u5c5e\u6027\u53ef\u4ee5\u5728\u8fd0\u884c\u671f\u624d\u51fa\u73b0\uff0c\u5c5e\u6027\u8bbf\u95ee\u5c31\u65e0\u6cd5\u4f18\u5316\u6210\u56fa\u5b9a\u504f\u79fb\u91cf\u7684\u5185\u5b58\u8bfb\u53d6\uff0c\u53ea\u80fd\u9000\u5316\u6210\u54c8\u5e0c\u67e5\u627e\uff0c\u6027\u80fd\u5927\u5e45\u4e0b\u964d\uff0c\u4e5f\u8ba9 AOT \u7f16\u8bd1\u96be\u4ee5\u8fdb\u884c\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-2\">\u4e8c\u3001\u7c7b\u578b\u7cfb\u7edf\uff1a\u540d\u4e49\u7c7b\u578b\u662f\u6838\u5fc3\u5dee\u5f02<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q4\uff1a\u4ec0\u4e48\u662f\u540d\u4e49\u7c7b\u578b\uff08Nominal Typing\uff09\uff1f\u548c\u7ed3\u6784\u7c7b\u578b\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">interface PointA { x: number; y: number }\ninterface PointB { x: number; y: number }\n\n\/\/ TypeScript\uff08\u7ed3\u6784\u7c7b\u578b\uff09\uff1a\u7ed3\u6784\u76f8\u540c\u5373\u53ef\u8d4b\u503c\uff0c\u7f16\u8bd1\u901a\u8fc7\nlet a: PointA = { x: 1, y: 2 }\nlet b: PointB = a          \/\/ OK\n\n\/\/ ArkTS\uff08\u540d\u4e49\u7c7b\u578b\uff09\uff1a\u9700\u8981\u663e\u5f0f\u58f0\u660e\u7c7b\u578b\u5173\u7cfb\ninterface PointB extends PointA { }   \/\/ \u6216\u7528 implements\nlet b: PointB = a as PointB           \/\/ \u9700\u8981\u663e\u5f0f\u8f6c\u6362<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5f71\u54cd\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u4ece TS \u8fc1\u8fc7\u6765\u7684\u4ee3\u7801\uff0c\u5f88\u591a\u9690\u5f0f\u517c\u5bb9\u7684\u8d4b\u503c\u4f1a\u62a5\u9519<\/strong>\u3002\u5904\u7406\u65b9\u5f0f\u662f\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">extends<\/code>\/<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">implements<\/code> \u663e\u5f0f\u5efa\u7acb\u5173\u7cfb\uff0c\u6216\u9002\u5ea6\u91cd\u6784\u7c7b\u578b\u5b9a\u4e49\uff0c\u800c\u4e0d\u662f\u5230\u5904 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">as<\/code> \u5f3a\u8f6c\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q5\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">as<\/code> \u7c7b\u578b\u8f6c\u6362\u5728 ArkTS \u91cc\u6709\u4ec0\u4e48\u9650\u5236\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u53ea\u80fd\u5728<strong style=\"color:#0f1c2e;font-weight:600\">\u6709\u7ee7\u627f\/\u5b9e\u73b0\u5173\u7cfb<\/strong>\u7684\u7c7b\u578b\u4e4b\u95f4\u8f6c\u6362\uff0c\u6216\u8005\u7528\u4e8e<strong style=\"color:#0f1c2e;font-weight:600\">\u53ef\u7a7a\u7c7b\u578b\u65ad\u8a00<\/strong>\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">obj!.prop<\/code>\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u80fd<\/strong>\u50cf TS \u90a3\u6837\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">as any<\/code> \u7ed5\u8fc7\u7c7b\u578b\u68c0\u67e5\u2014\u2014ArkTS \u5bf9 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">any<\/code> \u7684\u652f\u6301\u662f\u53d7\u9650\u7684\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u4f18\u5148\u7528<strong style=\"color:#0f1c2e;font-weight:600\">\u7c7b\u578b\u5b88\u536b<\/strong>\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">instanceof<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">typeof<\/code>\uff09\u505a\u5b89\u5168\u6536\u7a84\uff0c\u800c\u4e0d\u662f\u5f3a\u8f6c\u3002<\/li>\n<\/ul>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q6\uff1a\u6cdb\u578b\u4e0e\u7a7a\u5b89\u5168\u600e\u4e48\u843d\u5730\uff1f<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u6cdb\u578b\u7ea6\u675f\nfunction getFirst&lt;T extends object&gt;(list: T[]): T | undefined {\n  return list.length &gt; 0 ? list[0] : undefined\n}\n\n\/\/ \u7a7a\u5b89\u5168\uff1a\u53ef\u7a7a\u7c7b\u578b\u5fc5\u987b\u5904\u7406\nlet name: string | undefined = getName()\n\/\/ let len = name.length            \/\/ \u62a5\u9519\uff1a\u53ef\u80fd\u4e3a undefined\nlet len = name?.length ?? 0         \/\/ \u6b63\u786e\uff1a\u53ef\u9009\u94fe + \u7a7a\u503c\u5408\u5e76\n\nif (name !== undefined) {\n  console.info(name.length)         \/\/ \u6536\u7a84\u540e\u5b89\u5168\n}<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8981\u70b9\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">ArkTS \u7684\u7a7a\u5b89\u5168\u662f\u7f16\u8bd1\u671f\u5f3a\u5236\u7684<\/strong>\uff0c\u4e0e Kotlin\/Swift \u7684\u53ef\u7a7a\u7c7b\u578b\u601d\u8def\u4e00\u81f4\u3002\u517b\u6210\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">?. <\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">??<\/code> \u7684\u4e60\u60ef\uff0c\u6bd4\u5230\u5904\u52a0 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">!<\/code> \u65ad\u8a00\u66f4\u53ef\u53d6\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-3\">\u4e09\u3001\u5e76\u53d1\u6a21\u578b\uff1a\u9e3f\u8499\u9762\u8bd5\u7684\u6838\u5fc3\u533a<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q7\uff1a\u9e3f\u8499\u6709\u51e0\u79cd\u5e76\u53d1\u80fd\u529b\uff1f\u600e\u4e48\u9009\uff1f<\/h3>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;border:1px solid #e3eaf3;border-radius:10px;overflow:hidden\">\n<thead>\n<tr>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u80fd\u529b<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u5b9a\u4f4d<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u751f\u547d\u5468\u671f<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u9002\u7528\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">TaskPool<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u4efb\u52a1\u6c60\uff0c\u7cfb\u7edf\u7edf\u4e00\u8c03\u5ea6<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u4efb\u52a1\u7ea7\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u65e0\u9700\u624b\u52a8\u7ba1\u7406<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u9996\u9009<\/strong>\uff1aCPU \u5bc6\u96c6\u3001\u77ed\u4efb\u52a1\u3001\u53ef\u5e76\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">Worker<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u72ec\u7acb\u7684\u5e38\u9a7b\u7ebf\u7a0b<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u9700\u624b\u52a8\u521b\u5efa\/\u9500\u6bc1<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u957f\u9a7b\u4efb\u52a1\u3001\u9700\u8981\u4fdd\u6301\u72b6\u6001\u3001\u8017\u65f6\u540e\u53f0\u4efb\u52a1<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">Promise\/async<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u540c\u4e00\u7ebf\u7a0b\u5185\u7684\u5f02\u6b65<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u2014<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u8131\u79bb\u4e3b\u7ebf\u7a0b<\/strong>\uff1aIO \u7b49\u5f85\u3001\u987a\u5e8f\u7f16\u6392<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #d94f5c;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e00\u53e5\u8bdd\u9009\u578b\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u80fd\u7528 TaskPool \u5c31\u7528 TaskPool\uff0c\u9700\u8981\u5e38\u9a7b\u624d\u7528 Worker\uff0c\u53ea\u662f\u7b49 IO \u7528 Promise \u5c31\u591f\u4e86\u3002<\/strong>\u5f88\u591a\u4eba\u7684\u8bef\u533a\u662f\u628a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">async\/await<\/code> \u5f53\u6210&#8221;\u591a\u7ebf\u7a0b&#8221;\u2014\u2014\u5b83\u53ea\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u963b\u585e\u5f53\u524d\u7ebf\u7a0b\u7684\u7b49\u5f85<\/strong>\uff0c\u5b9e\u9645\u6267\u884c\u4ecd\u5728\u539f\u7ebf\u7a0b\u3002<\/p>\n<\/blockquote>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q8\uff1aTaskPool \u600e\u4e48\u7528\uff1f\u6709\u4ec0\u4e48\u9650\u5236\uff1f<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">import { taskpool } from '@kit.ArkTS'\n\n@Concurrent\nfunction heavyCompute(data: number[]): number {\n  \/\/ \u8fd9\u4e2a\u51fd\u6570\u8fd0\u884c\u5728\u4efb\u52a1\u6c60\u7684\u5de5\u4f5c\u7ebf\u7a0b\u91cc\n  let sum = 0\n  for (const v of data) sum += v * v\n  return sum\n}\n\nasync function run() {\n  const data = generateLargeArray()\n  \/\/ \u6d3e\u53d1\u4efb\u52a1\uff0c\u8fd4\u56de Promise\n  const result = await taskpool.execute(heavyCompute, data) as number\n  console.info(`\u7ed3\u679c\uff1a${result}`)\n\n  \/\/ \u6279\u91cf\u6267\u884c\u591a\u4e2a\u4efb\u52a1\n  const tasks = chunks.map(c =&gt; new taskpool.Task(heavyCompute, c))\n  const results = await taskpool.execute(tasks) as number[]\n}<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e09\u4e2a\u786c\u6027\u9650\u5236\u5fc5\u987b\u8bb0\u4f4f\uff1a<\/p>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5fc5\u987b\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Concurrent<\/code> \u88c5\u9970\u5668<\/strong>\u6807\u6ce8\u5e76\u53d1\u51fd\u6570\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u51fd\u6570\u4f53\u5185\u4e0d\u80fd\u8bbf\u95ee\u5916\u90e8\u95ed\u5305\u53d8\u91cf<\/strong>\uff0c\u6240\u6709\u8f93\u5165\u53ea\u80fd\u901a\u8fc7\u53c2\u6570\u4f20\u5165\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u80fd\u4f7f\u7528\u7ebf\u7a0b\u672c\u5730\u5b58\u50a8\u3001\u4e0d\u80fd\u64cd\u4f5c UI<\/strong>\uff1b<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">taskpool<\/code> \u5de5\u4f5c\u7ebf\u7a0b\u91cc<strong style=\"color:#0f1c2e;font-weight:600\">\u6ca1\u6709 UI \u4e0a\u4e0b\u6587<\/strong>\u3002<\/li>\n<\/ol>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u53e6\u5916<strong style=\"color:#0f1c2e;font-weight:600\">\u4efb\u52a1\u6267\u884c\u6709\u65f6\u95f4\u4e0a\u9650<\/strong>\uff08\u957f\u8017\u65f6\u4efb\u52a1\u5efa\u8bae\u7528 Worker\uff09\uff0c\u4e14<strong style=\"color:#0f1c2e;font-weight:600\">\u7cfb\u7edf\u4f1a\u6839\u636e\u8d1f\u8f7d\u52a8\u6001\u8c03\u6574\u5de5\u4f5c\u7ebf\u7a0b\u6570\u91cf<\/strong>\uff0c\u4e0d\u8981\u4f9d\u8d56\u56fa\u5b9a\u5e76\u53d1\u6570\u505a\u4e1a\u52a1\u5047\u8bbe\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q9\uff1aWorker \u548c TaskPool \u7684\u6570\u636e\u4f20\u9012\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e24\u8005\u90fd<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u662f\u5171\u4eab\u5185\u5b58<\/strong>\uff0c\u90fd\u901a\u8fc7<strong style=\"color:#0f1c2e;font-weight:600\">\u7ed3\u6784\u5316\u514b\u9686\uff08\u5e8f\u5217\u5316\/\u53cd\u5e8f\u5217\u5316\uff09<\/strong>\u4f20\u9012\u6570\u636e\u3002\u533a\u522b\u5728\u4e8e\u901a\u4fe1\u6a21\u578b\uff1a<\/p>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">TaskPool<\/strong>\uff1a\u4e00\u6b21\u6027\u6d3e\u53d1\u4efb\u52a1\u5e76\u62ff\u56de\u7ed3\u679c\uff0c\u6a21\u578b\u7b80\u5355\uff0c\u9002\u5408\u65e0\u72b6\u6001\u8ba1\u7b97\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">Worker<\/strong>\uff1a\u901a\u8fc7 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">postMessage<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">onmessage<\/code> \u53cc\u5411\u6301\u7eed\u901a\u4fe1\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">Worker \u5185\u53ef\u4ee5\u6301\u6709\u957f\u671f\u72b6\u6001<\/strong>\u3002<\/li>\n<\/ul>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u4e3b\u7ebf\u7a0b\nconst worker = new worker.ThreadWorker('entry\/ets\/workers\/MyWorker.ets')\nworker.onmessage = (e: MessageEvents) =&gt; {\n  console.info(`\u6536\u5230\uff1a${e.data}`)\n}\nworker.postMessage({ cmd: 'start', payload: data })\n\/\/ \u7528\u5b8c\u5fc5\u987b\u9500\u6bc1\uff0c\u5426\u5219\u7ebf\u7a0b\u5e38\u9a7b\nworker.terminate()\n\n\/\/ Worker \u7ebf\u7a0b\uff08MyWorker.ets\uff09\nworkerPort.onmessage = (e: MessageEvents) =&gt; {\n  const result = process(e.data.payload)\n  workerPort.postMessage(result)\n}<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8ffd\u95ee&#8221;<strong style=\"color:#0f1c2e;font-weight:600\">\u80fd\u4e0d\u80fd\u5171\u4eab\u5185\u5b58\u907f\u514d\u62f7\u8d1d\uff1f<\/strong>&#8220;\u2014\u2014\u53ef\u4ee5\uff0c\u9e3f\u8499\u63d0\u4f9b\u4e86 <strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">SharedArrayBuffer<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Atomics<\/code><\/strong> \u7b49\u80fd\u529b\u7528\u4e8e\u5927\u6570\u636e\u91cf\u7684\u5171\u4eab\uff0c\u4f46\u9700\u8981<strong style=\"color:#0f1c2e;font-weight:600\">\u81ea\u5df1\u5904\u7406\u540c\u6b65<\/strong>\uff08\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Atomics<\/code> \u505a\u539f\u5b50\u64cd\u4f5c\u4e0e\u7b49\u5f85\u901a\u77e5\uff09\u3002\u8fd9\u662f\u8fdb\u9636\u8003\u70b9\uff0c\u80fd\u8bf4\u51fa\u6765\u8bf4\u660e\u505a\u8fc7\u771f\u5b9e\u7684\u6027\u80fd\u4f18\u5316\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q10\uff1a\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u5728\u5b50\u7ebf\u7a0b\u66f4\u65b0 UI\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u56e0\u4e3a <strong style=\"color:#0f1c2e;font-weight:600\">UI \u7ec4\u4ef6\u6811\u4e0d\u662f\u7ebf\u7a0b\u5b89\u5168\u7684<\/strong>\u3002ArkUI \u7684\u7ec4\u4ef6\u6811\u5728\u4e3b\u7ebf\u7a0b\u6784\u5efa\u548c\u5237\u65b0\uff0c\u5982\u679c\u5141\u8bb8\u591a\u7ebf\u7a0b\u5e76\u53d1\u4fee\u6539\uff0c\u4f1a\u9700\u8981\u5927\u91cf\u9501\u6765\u4fdd\u8bc1\u4e00\u81f4\u6027\uff0c\u4ee3\u4ef7\u8fdc\u8d85\u6536\u76ca\u3002\u8fd9\u4e5f\u662f\u51e0\u4e4e\u6240\u6709 UI \u6846\u67b6\u7684\u5171\u8bc6\uff08Android\u3001iOS\u3001Flutter \u90fd\u662f\u5355\u7ebf\u7a0b UI \u6a21\u578b\uff09\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6b63\u786e\u505a\u6cd5\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u5b50\u7ebf\u7a0b\u7b97\u5b8c \u2192 \u628a\u7ed3\u679c\u4f20\u56de\u4e3b\u7ebf\u7a0b \u2192 \u66f4\u65b0\u72b6\u6001\u53d8\u91cf \u2192 \u89e6\u53d1 UI \u5237\u65b0<\/strong>\u3002\u8017\u65f6\u4efb\u52a1\u7ed3\u675f\u540e\u901a\u5e38\u9700\u8981\u5207\u56de\u4e3b\u7ebf\u7a0b\u66f4\u65b0 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code>\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-4\">\u56db\u3001\u72b6\u6001\u7ba1\u7406\u4e0e\u6e32\u67d3\uff1a\u5e38\u89c1\u7684\u8fde\u73af\u8ffd\u95ee<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q11\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Prop<\/code> \u7684\u533a\u522b\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code><\/strong>\uff1a\u7ec4\u4ef6<strong style=\"color:#0f1c2e;font-weight:600\">\u79c1\u6709<\/strong>\u72b6\u6001\uff0c\u53d8\u5316\u65f6\u89e6\u53d1<strong style=\"color:#0f1c2e;font-weight:600\">\u8be5\u7ec4\u4ef6\u53ca\u5176\u5b50\u7ec4\u4ef6<\/strong>\u7684\u91cd\u65b0\u6e32\u67d3\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u5fc5\u987b\u521d\u59cb\u5316\u3002<\/strong><\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Prop<\/code><\/strong>\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u5355\u5411<\/strong>\u4ece\u7236\u7ec4\u4ef6\u4f20\u5165\uff0c\u5b50\u7ec4\u4ef6\u5185\u90e8\u4fee\u6539<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u4f1a\u540c\u6b65\u56de\u7236\u7ec4\u4ef6<\/strong>\u3002\u9002\u5408&#8221;\u7236\u7ed9\u5b50\u4f20\u503c\uff0c\u5b50\u53ea\u8bfb\u6216\u672c\u5730\u6539&#8221;\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Link<\/code><\/strong>\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u53cc\u5411<\/strong>\u7ed1\u5b9a\uff0c\u5b50\u7ec4\u4ef6\u7684\u4fee\u6539\u4f1a\u540c\u6b65\u56de\u7236\u7ec4\u4ef6\u7684 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code>\u3002\u8c03\u7528\u65f6\u8981\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">$<\/code> \u8bed\u6cd5\u4f20\u5f15\u7528\u3002<\/li>\n<\/ul>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">@Component\nstruct Child {\n  @Prop countProp: number = 0      \/\/ \u5355\u5411\n  @Link countLink: number          \/\/ \u53cc\u5411\n  build() { \/* ... *\/ }\n}\n\n@Component\nstruct Parent {\n  @State count: number = 0\n  build() {\n    Child({ countProp: this.count, countLink: $count })   \/\/ Link \u7528 $\n  }\n}<\/code><\/pre>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q12\uff1a\u6df1\u62f7\u8d1d vs \u6d45\u62f7\u8d1d\u5728\u72b6\u6001\u66f4\u65b0\u91cc\u7684\u5751\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6838\u5fc3\u9677\u9631\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u76f4\u63a5\u4fee\u6539\u5bf9\u8c61\u5185\u90e8\u5b57\u6bb5\u4e0d\u4f1a\u89e6\u53d1\u5237\u65b0\uff0c\u5fc5\u987b\u6574\u4f53\u66ff\u6362\u5f15\u7528\u3002<\/strong><\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u53cd\u4f8b\uff1a\u6539\u4e86\u5b57\u6bb5\u4f46\u5f15\u7528\u6ca1\u53d8\uff0cUI \u4e0d\u4f1a\u5237\u65b0\nthis.user.name = 'Tom'           \/\/ @State user: User\uff0c\u4e0d\u4f1a\u89e6\u53d1\u66f4\u65b0\n\n\/\/ \u6b63\u4f8b\uff1a\u6574\u4f53\u66ff\u6362\nthis.user = new User('Tom', this.user.age)\n\/\/ \u6216\u5c55\u5f00\u8bed\u6cd5\nthis.user = { ...this.user, name: 'Tom' }\n\n\/\/ \u6570\u7ec4\u7684\u540c\u7406\nthis.list.push(item)                    \/\/ \u4e0d\u4e00\u5b9a\u89e6\u53d1\nthis.list = [...this.list, item]        \/\/ \u6b63\u786e<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u539f\u7406\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">@State \u7684\u89c2\u5bdf\u7c92\u5ea6\u662f&#8221;\u5f15\u7528\u662f\u5426\u53d8\u5316&#8221;\uff08\u6d45\u89c2\u5bdf\uff09<\/strong>\u3002\u6df1\u5c42\u7684\u5d4c\u5957\u5bf9\u8c61\u53d8\u5316\u9700\u8981\u914d\u5408 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observed<\/code> + <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObjectLink<\/code> \u624d\u80fd\u88ab\u89c2\u5bdf\u5230\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q13\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observed<\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObjectLink<\/code> \u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f<\/h3>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">@Observed\nclass User {\n  name: string\n  age: number\n  constructor(name: string, age: number) { this.name = name; this.age = age }\n}\n\n@Component\nstruct UserCard {\n  @ObjectLink user: User        \/\/ \u80fd\u89c2\u5bdf\u5230\u5d4c\u5957\u5bf9\u8c61\u5185\u90e8\u7684\u5c5e\u6027\u53d8\u5316\n  build() {\n    Row() {\n      Text(this.user.name)\n      Button('\u6539\u540d').onClick(() =&gt; { this.user.name = 'Jerry' })  \/\/ \u4f1a\u5237\u65b0\n    }\n  }\n}<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5173\u952e\u70b9\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observed<\/code> \u88c5\u9970<strong style=\"color:#0f1c2e;font-weight:600\">\u7c7b<\/strong>\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObjectLink<\/code> \u88c5\u9970<strong style=\"color:#0f1c2e;font-weight:600\">\u5b50\u7ec4\u4ef6\u4e2d\u7684\u53d8\u91cf<\/strong>\uff0c\u4e14<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u80fd\u5728\u5b50\u7ec4\u4ef6\u91cc\u521d\u59cb\u5316<\/strong>\uff08\u5fc5\u987b\u7531\u7236\u7ec4\u4ef6\u4f20\u5165\uff09\u3002\u8fd9\u5957\u7ec4\u5408\u662f\u5904\u7406&#8221;\u5d4c\u5957\u5bf9\u8c61\/\u6570\u7ec4\u5143\u7d20&#8221;\u5237\u65b0\u7684\u6807\u51c6\u65b9\u6848\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-5\">\u4e94\u3001\u5e38\u89c1\u8e29\u5751\u6e05\u5355<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q14\uff1aArkTS \u91cc\u6700\u5bb9\u6613\u72af\u7684\u9519\u8bef\u6709\u54ea\u4e9b\uff1f<\/h3>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u628a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">async\/await<\/code> \u5f53\u591a\u7ebf\u7a0b\u7528<\/strong>\u2014\u2014\u5b83\u4e0d\u8131\u79bb\u5f53\u524d\u7ebf\u7a0b\uff0cCPU \u5bc6\u96c6\u4efb\u52a1\u7167\u6837\u5361 UI\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5728\u5b50\u7ebf\u7a0b\u91cc\u76f4\u63a5\u6539 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code><\/strong>\u2014\u2014\u8de8\u7ebf\u7a0b\u64cd\u4f5c UI \u672a\u5b9a\u4e49\u884c\u4e3a\uff0c\u5fc5\u987b\u5207\u56de\u4e3b\u7ebf\u7a0b\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u76f4\u63a5\u6539\u5bf9\u8c61\u5b57\u6bb5\u671f\u671b\u5237\u65b0<\/strong>\u2014\u2014\u5fc5\u987b\u6574\u4f53\u66ff\u6362\u5f15\u7528\uff0c\u6216\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observed\/@ObjectLink<\/code>\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5728 build \u91cc\u505a\u8017\u65f6\u64cd\u4f5c<\/strong>\u2014\u2014<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">build()<\/code> \u4f1a\u88ab\u9891\u7e41\u8c03\u7528\uff0c\u5fc5\u987b\u4fdd\u6301\u8f7b\u91cf\uff0c\u4e14<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u5141\u8bb8\u6709\u526f\u4f5c\u7528<\/strong>\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5728 build \u91cc\u6539\u72b6\u6001<\/strong>\u2014\u2014\u4f1a\u9020\u6210<strong style=\"color:#0f1c2e;font-weight:600\">\u65e0\u9650\u91cd\u5efa\u5faa\u73af<\/strong>\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">Worker \u5fd8\u4e86 terminate<\/strong>\u2014\u2014\u7ebf\u7a0b\u5e38\u9a7b\uff0c\u5185\u5b58\u548c CPU \u6301\u7eed\u5360\u7528\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u628a\u5927\u91cf\u6570\u636e\u901a\u8fc7 postMessage \u9891\u7e41\u4f20\u9012<\/strong>\u2014\u2014\u5e8f\u5217\u5316\u5f00\u9500\u5927\uff0c\u5927\u6570\u636e\u5e94\u8003\u8651\u5171\u4eab\u5185\u5b58\u6216\u5206\u6279\u3002<\/li>\n<\/ol>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #d94f5c40\">Q15\uff1a\u600e\u4e48\u6392\u67e5&#8221;UI \u4e0d\u5237\u65b0&#8221;\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u7ed9\u4e00\u5957\u6392\u67e5\u987a\u5e8f\uff1a<\/p>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u786e\u8ba4\u72b6\u6001\u53d8\u91cf\u662f\u5426\u7528\u4e86<strong style=\"color:#0f1c2e;font-weight:600\">\u6b63\u786e\u7684\u88c5\u9970\u5668<\/strong>\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Link<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObjectLink<\/code>\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u786e\u8ba4\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u6574\u4f53\u66ff\u6362\u4e86\u5f15\u7528<\/strong>\u800c\u4e0d\u662f\u53ea\u6539\u4e86\u5185\u90e8\u5b57\u6bb5\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u786e\u8ba4\u4fee\u6539\u53d1\u751f\u5728<strong style=\"color:#0f1c2e;font-weight:600\">\u4e3b\u7ebf\u7a0b<\/strong>\uff08\u5b50\u7ebf\u7a0b\u56de\u8c03\u91cc\u6539\u72b6\u6001\u4e0d\u4f1a\u751f\u6548\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u786e\u8ba4<strong style=\"color:#0f1c2e;font-weight:600\">\u88ab\u89c2\u5bdf\u7684\u5bf9\u8c61\u7c7b\u578b<\/strong>\u662f\u5426\u652f\u6301\u89c2\u5bdf\uff08\u57fa\u7840\u7c7b\u578b\u3001\u6570\u7ec4\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observed<\/code> \u7c7b\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u7528 DevEco Studio \u7684 <strong style=\"color:#0f1c2e;font-weight:600\">ArkUI Inspector<\/strong> \u770b\u7ec4\u4ef6\u6811\u4e0e\u72b6\u6001\uff0c\u786e\u8ba4\u6570\u636e\u662f\u5426\u771f\u7684\u53d8\u4e86\u3002<\/li>\n<\/ol>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #d94f5c;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-6\">\u516d\u3001\u5c0f\u7ed3<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">ArkTS \u4e0e\u5e76\u53d1\u8fd9\u4e00\u5757\u7684\u7b54\u9898\u4e3b\u7ebf\u662f<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;\u7ea6\u675f\u53ca\u5176\u7406\u7531&#8221;<\/strong>\uff1a\u8bed\u8a00\u5c42\u9762\u7684\u6bcf\u4e00\u6761\u9650\u5236\uff08\u7981\u6b62\u52a8\u6001\u5c5e\u6027\u3001\u540d\u4e49\u7c7b\u578b\u3001\u5f3a\u5236\u521d\u59cb\u5316\uff09\u90fd\u6307\u5411\u540c\u4e00\u4e2a\u76ee\u7684\u2014\u2014<strong style=\"color:#0f1c2e;font-weight:600\">\u8ba9\u7f16\u8bd1\u5668\u80fd\u5728\u7f16\u8bd1\u671f\u786e\u5b9a\u5bf9\u8c61\u5e03\u5c40\uff0c\u4ece\u800c\u505a\u6fc0\u8fdb\u4f18\u5316<\/strong>\u3002\u5e76\u53d1\u5c42\u9762\u7684\u4e09\u6761\u80fd\u529b\uff08Promise \/ TaskPool \/ Worker\uff09\u5219\u5bf9\u5e94<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;\u7b49\u5f85&#8221;\u3001&#8221;\u77ed\u4efb\u52a1\u5e76\u884c&#8221;\u3001&#8221;\u957f\u9a7b\u4efb\u52a1&#8221;<\/strong>\u4e09\u79cd\u9700\u6c42\uff0c\u9009\u9519\u5c31\u5bb9\u6613\u51fa\u73b0&#8221;\u6211\u4ee5\u4e3a\u5f02\u6b65\u4e86\u4f46 UI \u8fd8\u662f\u5361&#8221;\u8fd9\u79cd\u5178\u578b\u95ee\u9898\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u51c6\u5907\u7b56\u7565\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u628a&#8221;ArkTS \u4e0d\u662f TypeScript&#8221;\u548c&#8221;async \u4e0d\u7b49\u4e8e\u591a\u7ebf\u7a0b&#8221;\u8fd9\u4e24\u53e5\u8bdd\u8bb2\u900f<\/strong>\uff0c\u518d\u914d\u4e0a TaskPool \u4e0e Worker \u7684\u9009\u578b\u5bf9\u7167\uff0c\u8fd9\u4e00\u5757\u57fa\u672c\u5c31\u7a33\u4e86\u3002<\/p>\n<hr style=\"border:none;border-top:1px solid #eaeef4;margin:34px 0\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><em style=\"color:#5a6b85;font-style:normal;background:#d94f5c1f;padding:1px 4px;border-radius:4px\">\u53c2\u8003\uff1a<a href=\"https:\/\/developer.huawei.com\/consumer\/cn\/doc\/harmonyos-guides\/arkts-get-started\" target=\"_blank\" rel=\"noopener\" style=\"color:#d94f5c;text-decoration:none;border-bottom:1px solid #d94f5c66;transition:opacity .15s\">HarmonyOS ArkTS \u5f00\u53d1\u6307\u5357<\/a>\u3001<a href=\"https:\/\/developer.huawei.com\/consumer\/cn\/doc\/harmonyos-guides\/taskpool-introduction\" target=\"_blank\" rel=\"noopener\" style=\"color:#d94f5c;text-decoration:none;border-bottom:1px solid #d94f5c66;transition:opacity .15s\">TaskPool \u5b98\u65b9\u6587\u6863<\/a>\u3002\u8bed\u8a00\u89c4\u8303\u4e0e API \u968f\u7248\u672c\u8fed\u4ee3\uff0c\u8bf7\u4ee5\u6240\u7528 SDK \u7248\u672c\u7684\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002<\/em><\/p>\n<div style=\"margin:42px 0 0;padding:22px 0 0;border-top:1px solid #eaeef4\">\n<div style=\"font-size:13px;color:#93a1b5;letter-spacing:1px;margin-bottom:12px\">\u6807\u7b7e<\/div>\n<p><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u9e3f\u8499\u9762\u8bd5\u9898<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#ArkTS<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u5e76\u53d1<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u9762\u8bd5<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ArkTS \u8bed\u8a00\u7279\u6027\u4e0e\u5e76\u53d1\u6a21\u578b\u662f\u9e3f\u8499\u9762\u8bd5\u91cc\u6700\u80fd\u533a\u5206\u5199\u8fc7 Demo \u548c\u505a\u8fc7\u9879\u76ee\u7684\u4e00\u5757\u3002\u672c\u6587\u6309\u8bed\u8a00\u7ea6\u675f\u3001\u7c7b\u578b\u7cfb\u7edf\u3001\u5e76\u53d1\u6a21\u578b\u3001\u7ebf\u7a0b\u901a\u4fe1\u3001\u5e38\u89c1\u5751\u7ec4\u7ec7\uff0c\u8bb2\u6e05\u6bcf\u4e00\u6761\u9650\u5236\u7684\u771f\u6b63\u7406\u7531\uff0c\u5e76\u7ed9\u51fa UI \u4e0d\u5237\u65b0\u65f6\u7684\u6392\u67e5\u987a\u5e8f\u3002<\/p>\n","protected":false},"author":1,"featured_media":248,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[47,106,66,124],"class_list":["post-250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-question-bank","category-harmony-question-bank","tag-arkts","tag-106","tag-66","tag-124"],"_links":{"self":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":0,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media\/248"}],"wp:attachment":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}