登录

立即登录

去注册

忘记密码?

验证码登录

点击获取验证码

立即登录

去注册

注册

点击获取验证码

立即注册

找回密码

点击获取验证码

确定

全部资讯

全部资讯   / 拼多多电商部二面考题整理(2020年)

拼多多电商部二面考题整理(2020年)

2021-12-25 11:09:48

<div class="WordSection1"> <p class="MsoNormal" style="margin-top:6.9pt;text-indent:119.0pt;line-height: 93%"><span style="font-size:17.5pt;line-height:93%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">拼多多电商</span><span style="font-size:17.5pt;line-height: 93%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">部二面整理</span><span lang="EN-US" style="font-size:17.5pt;line-height:93%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:190%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">1</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-3.75pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">并发编程三要素?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">原子性</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.55pt;margin-right:2.1pt;margin-bottom: 0cm;margin-left:1.3pt;margin-bottom:.0001pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">原子性指的是一个或</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">者多个操作</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">要么全部执行并且在执行的过程中不被其他操作打断</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">要</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">么就全部</span><span style="letter-spacing: .35pt">都不执行</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">可见性</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.55pt;margin-right:2.1pt;margin-bottom: 0cm;margin-left:1.8pt;margin-bottom:.0001pt;text-indent:-.65pt;line-height: 125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">可见性指多个线程操作一个</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">共享变量时</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">其中一个线程对变量进行修改后</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">其他线程可以立</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">即</span><span style="letter-spacing: .3pt">看到修改的结果</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">有序性</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.65pt;text-indent:1.15pt;line-height: 95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">有序性</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">即程序的执行顺序按照代码的先后顺序来执行</span><span style="font-size: 10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">2</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.15pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">实现可见性的方法有哪些?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.55pt;margin-right:1.75pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:125%"><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">sy</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">z</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">或者</span><span style="font-size:10.0pt;line-height:125%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.55pt">:保证同一个时刻只有一个线程获取</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">锁执行代码</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">锁释放之前把最</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">新的值刷新到</span><span style="letter-spacing:.4pt">主内存</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.4pt">实现可见性</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:136%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:136%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">3</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">多线程的价值?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">1</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)发挥多核</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">的优</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">势</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.35pt;margin-right:1.85pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.4pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">多线程</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">可以真正发挥出</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">多核</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">的优势来</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">达到充分利用</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">的目的</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">采用多线程的</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">方式去同时完成几件事情而不互</span><span style="letter-spacing:.4pt">相干扰</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.35pt">防止阻</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">塞</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.65pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.15pt;line-height: 121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">从程</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">序运行效率的角度来看</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">单核</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">不但不会发挥出多线程的优势</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">反而会因为在单核</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">上运行多线程导致线程上下文的切换,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">而降低程序整体的效率</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">但是单核</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">我们还</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">是</span><span style="letter-spacing: .45pt">要应用多线程</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">就是为了防止阻塞</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.45pt">试想</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">如果单核</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">使用单线程</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">那么只要这个线</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">程阻塞了,比方说远程读取某个数据吧,</span><span style="letter-spacing:.35pt">对端迟迟未返回又没有设置超时时间</span><span style="letter-spacing: .4pt">,</span><span style="letter-spacing:.35pt">那么你的整</span> <span style="letter-spacing:.45pt">个程序在数据返回回来之前就停止运</span><span style="letter-spacing: .4pt">行了</span><span style="letter-spacing:.45pt">。</span><span style="letter-spacing:.4pt">多线程可以防止这个问题</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.4pt">多条线程同时运行</span><span style="letter-spacing:.45pt">,</span> <span style="letter-spacing:.5pt">哪怕一条线程的代码执行读</span><span style="letter-spacing: .45pt">取数据阻塞</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">也不会影响其它任务的执行</span><span style="letter-spacing: .5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.35pt">便于建</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">模</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.5pt;margin-right:2.0pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">这是另外一个没有这么明显的优点了</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">假设有一个大的任务</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">单线程编程</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">那么</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">就要考</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">虑很多,建立整个程序模型比较麻烦。但是如果把这个大的任务</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.3pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">分解成几个小任务</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">任</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">务</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">、</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">任务</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">、</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">任务</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">D</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">分别建立程序模型</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">并通过</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">多线程分别运行这几个任务</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">那就简</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">单</span><span style="letter-spacing: .3pt">很多了</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection2"> <p class="MsoNormal" style="margin-top:9.0pt;text-indent:.95pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">4</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.85pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">创建线程的有哪些方式?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.5pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)继承</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">Th</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">类创</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">建线程类</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">通过</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">Runnab</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">接口创建线程类</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)通过</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">Ca</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">ll</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">ab</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">和</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">F</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">创建</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">线程</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:130%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">4</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">通过线程</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">池创建</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:145%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:146%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.35pt;line-height: 98%;mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">5</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-3.2pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">创建线程的三种方式的对比?</span><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.55pt;text-indent:1.6pt;line-height:17.35pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.2pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.35pt">采用实现</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.2pt">Runnab</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.15pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.4pt">、</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.2pt">ab</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.35pt">接口的方式创建多线程</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.05pt;line-height:94%"><span style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">优势是</span><span style="font-size:10.0pt;line-height: 94%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">:</span><span lang="EN-US" style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">线程类只是实现了</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Runnab</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">接口或</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ab</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">接口,还可以继</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">承其他类</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">在这种方式下</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">多</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">个线程可以共享同一个</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ge</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">对象,所以非常</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">适合多个相同线程来处理同一份资源的情况</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">从而可以将</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">P</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">、</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">代码和数据分开</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">形成清晰的模型</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">较好地体现了面向对象的思想</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:110%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.35pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">劣势</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt">是</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.15pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">编程稍微复杂</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">如果要访问当前线程</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">则必须使用</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Th</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">ead</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">.</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">rr</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">en</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">Th</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">()</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">方法</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:17.35pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.45pt">使用继承</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.25pt">Th</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.25pt">ead</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise: 3.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.45pt">类的方式创建多线</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.4pt">程</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.05pt;line-height:94%"><span style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">优势是</span><span style="font-size:10.0pt;line-height: 94%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">:</span><span lang="EN-US" style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.8pt;margin-bottom:.0001pt;text-indent:-.65pt;line-height: 125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">编写简单</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">如果需要访问当前线程</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">则无需使用</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">.</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">en</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">()</span><span style="font-size:10.0pt;line-height:125%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">方法</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">直接使用</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">即</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">可获得当前线程</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.35pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">劣势</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt">是</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.2pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">线程类已经继承了</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Th</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">ead</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">类</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.55pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">所以不能再继承其他父类</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Runnab</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">和</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Ca</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">ll</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">ab</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">的区</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">别</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;text-indent:1.55pt;line-height:14.0pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">1</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">、</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">ab</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.35pt">规定(重写</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.35pt">的方法是</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">()</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp;</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.4pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">Runnab</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">规定(重写</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.3pt">的方法是</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">un</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.1pt">()</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.25pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">2 </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">、</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">b</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.4pt">的任务执行后可返回值</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">而</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Runn</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">b</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.4pt">的任务是不能返回值的</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.2pt;line-height:13.95pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">3</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">、</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">方法可以抛出异常</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">un</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">方法不可以</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:-.25pt;line-height: 116%"><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.25pt">4</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">、运行</span><span style="font-size:10.0pt;line-height: 116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Ca</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ll</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ab</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">任务可以拿到一个</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">Fu</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">对象,表示异步计算的结果。它提供</span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">了检查计</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.55pt">算是否完成的</span><span style="letter-spacing: .5pt">方法</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">以等待计算的完成</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">并检索计算的结果</span><span style="letter-spacing:.6pt">。</span><span style="letter-spacing:.5pt">通过</span><span style="letter-spacing:.35pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">F</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:116%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">对象可以了解任</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">务执行情况</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.45pt">可取消任务的执行</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">还可获取执行结果</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection3"> <p class="MsoNormal" style="line-height:147%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:147%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">6</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.25pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程的状态流转图</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;text-indent:1.2pt;line-height:94%"><span style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">线程的生命周</span><span style="font-size:10.0pt;line-height: 94%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">期及五种基本状态</span><span style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:94%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:139%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="text-indent:.7pt;line-height:276.95pt;mso-line-height-rule: exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="IM_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:393.6pt;height:277.2pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img width="525" height="370" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg" v:shapes="IM_x0020_1"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 91%;mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">7</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.9pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:91%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">Java</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程具有五中基本状态</span><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.55pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">新建状态(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">N</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">w</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">):</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.85pt;text-indent:1.75pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">当线程</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">对象对创建后</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">即进入了新建状态</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">如</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">:</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">T</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">ea</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">= </span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">yT</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">ea</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">;</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">就绪状态(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">Runn</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.05pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">b</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.05pt">le</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">):</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.65pt;margin-right:.3pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.65pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">当调</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">用线程对象的</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">st</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">rt</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">方法(</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">.</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">st</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">rt</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">();</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">),</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">线程即进入就绪状态</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">处于就绪状态的线程</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">只是说明此线程已经做好了准备</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">随时等待</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">调度执行</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">并不是说执行了</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">.</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">rt</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">此线程</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">立即就会执</span><span style="letter-spacing:.3pt">行</span><span style="letter-spacing:.4pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.9pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">运行状态(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">Runn</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ng</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">:</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.45pt;margin-right:.65pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.65pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">当</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">开始调度处于就绪状态的线程时,此时线程才得以真正执行,即进入到</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">运行状态</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">注</span><span style="letter-spacing: .55pt">:</span><span style="letter-spacing:.5pt">就</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.5pt">绪状态是进入到运行状态的唯一入口</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">也就是说</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">线程要想进入运行状态执</span><span style="letter-spacing:.45pt">行</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">首</span> <span style="letter-spacing:.4pt">先必须处于就绪状态中</span><span style="letter-spacing:.45pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:12.45pt;text-indent:1.6pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">4</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">阻塞状态(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">B</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">cke</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">d</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">):</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.35pt;text-indent:1.3pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">处于运行</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">状态中的线程由于某种原因</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">暂时放弃对</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">的使用权</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">停止执行</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">此时进入阻</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection4"> <p class="MsoNormal" style="margin-top:3.0pt;margin-right:39.95pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:233%"><span style="font-size:10.0pt;line-height:233%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">塞状态,直到其进入到就绪状态,才</span><span style="font-size:10.0pt; line-height:233%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span style="font-size:10.0pt;line-height:233%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">有机会再次被</span><span style="font-size:10.0pt;line-height: 233%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:233%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:233%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:233%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:233%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">调用以进入到运</span><span style="font-size:10.0pt;line-height:233%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">行状态</span><span style="font-size:10.0pt;line-height: 233%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-size:10.0pt;line-height:233%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">根据阻塞产生的原因不同</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">阻塞状态又可以分为三种</span><span style="letter-spacing:.55pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.05pt;margin-right:39.05pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:.3pt;line-height:237%"><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">1</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">)</span><span style="font-size: 10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">等待阻塞</span><span style="font-size:10.0pt;line-height:237%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">:</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">运行状态中的线程执行</span><span style="font-size:10.0pt; line-height:237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t()</span><span style="font-size:10.0pt;line-height:237%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">方法</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">使本线</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">程进入到等待阻塞状态</span><span style="font-size:10.0pt; line-height:237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">;</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:237%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;line-height: 237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">)同步阻塞:线程在获取</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">sy</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ed</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">同步</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">锁失败</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">(</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">因为锁被其它线程所占用</span><span lang="EN-US" style="font-size: 10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.1pt">)</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span lang="EN-US" style="font-size:10.0pt; line-height:237%;font-family:宋体;mso-bidi-font-family:宋体">&nbsp; </span><span style="font-size:10.0pt; line-height:237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">它会进入同步阻</span><span style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">塞状态</span><span style="font-size:10.0pt;line-height: 237%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">;</span><span lang="EN-US" style="font-size:10.0pt;line-height:237%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.8pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.15pt;line-height: 116%"><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.25pt">3</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">其他阻塞</span><span style="font-size:10.0pt;line-height: 116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">:</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">通过调用线程的</span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">eep</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">()</span><span style="font-size:10.0pt;line-height:116%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">或</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">()</span><span style="font-size:10.0pt;line-height:116%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">或发出了</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">/</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">O</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">请求时</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">线程会进入到阻塞状</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">态</span><span style="letter-spacing: .55pt">。</span><span style="letter-spacing:.45pt">当</span><span style="letter-spacing:.35pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">eep</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">状态超时</span><span style="font-size:10.0pt;line-height: 116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">、</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">()</span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">等待线程终止或者超时</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">、</span><span style="font-size:10.0pt;line-height: 116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">或者</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">/</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">O</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">处理完毕时</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">线程重新转</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">入就绪状</span><span style="letter-spacing: .3pt">态</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">5</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">死亡状态(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">De</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">d</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">):</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;text-indent:1.2pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">线</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">程执行完了或者因异常退出了</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">un</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">方法</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.55pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">该线程结束生命周期</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.1pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">8</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.7pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是线程池?有哪几种创建方式?</span><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNoSpacing" style="line-height:150%"><span style="font-size:10.0pt; line-height:150%;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">线程池就是提前创建若干个线程,如果有任务需要处理,线程池里的线程就会处理任务,处 理完之后线程并不会被销毁,而是等待下一个任务。由于创建和销毁线程都是消耗系统资源的,所以当你想要频繁的创建和销毁线程的时候就可以考虑使用线程池来提升系统的性能。 <span lang="EN-US">java&nbsp; </span>提供了一个 <span lang="EN-US">java.util.concurrent.Executor&nbsp; </span>接口的实现用于创建线程池。<span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:147%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.15pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">9</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-1.55pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">四种线程池的创建<span style="letter-spacing:-1.55pt">:</span></span><span lang="EN-US" style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.55pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ne</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">w</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">CachedTh</span><span lang="EN-US" style="font-size: 10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">Poo</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">l&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.3pt">创建一个可缓存线程池</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ne</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">F</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">xedTh</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">Poo</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">l&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">创建一个</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">定长线程池</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">可控制线程最大并发数</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ne</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">Schedu</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">edTh</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">Poo</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.4pt">创建一个定长线程池</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">支持定时及</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">周期性任务执行</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:.3pt;line-height:114%"><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">4</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ne</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">g</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">eTh</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">E</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">x</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">创建一个单线程化的线程池</span><span style="font-size:10.0pt;line-height:114%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">它只会用唯一的工作线程来执</span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">行任务</span><span style="letter-spacing:.3pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.7pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">10</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.8pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程池的优点?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">重用存在的线</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">程</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">减少对象创建销毁的开销</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)可有效的控制最大并发线程数,提高系统资源的使用率,</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">同时避免过多资源竞争</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">避</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection5"> <p class="MsoNormal" style="margin-top:3.05pt;text-indent:1.35pt;line-height: 95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">免堵</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt">塞</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">提供定时执行</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">、</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">定期执行</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">、</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">单线程</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">、</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">并发数控制等功能</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:145%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:146%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:98%; mso-outline-level:1"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">11</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.6pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">常用的并发工具类有哪些?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.5pt;text-indent:1.6pt;line-height:31.2pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.4pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing: .25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise: 14.5pt;letter-spacing:.25pt">Coun</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.25pt">Do</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise: 14.5pt;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing: .2pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.15pt">La</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise: 14.5pt;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing: .15pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.2pt">h</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.6pt;line-height:13.95pt;mso-line-height-rule: exactly"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.2pt">2</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">yc</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">li</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">cBa</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">rr</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">pho</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">4</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.35pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">Exchan</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">ge</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.05pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">12</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-3.3pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">CyclicBarrier</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">和</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt">CountDownLatch</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">的区别</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.45pt;margin-right:.4pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">1</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">oun</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">D</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">nLa</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ch</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">简单的说就是一个</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">线程等待</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">直到他所等待的其他线程都执行完成并</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">且调用</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">oun</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">D</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">()</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">方法发出通知后</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">当前线程才可以继续</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">执行</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:15.3pt;margin-right:2.95pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:114%"><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">y</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">li</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">B</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">是所有线程都进行等待,直到所有线程都准备好</span><span style="font-size: 10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">进入</span><span style="font-size:10.0pt;line-height:114%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">方法之后</span><span style="font-size:10.0pt;line-height: 114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">所有线程同时开始执行</span><span style="letter-spacing: .45pt">!</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.45pt;line-height: 116%"><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">3</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">Coun</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">D</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .4pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">的计数器只能使用一次。而</span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">Cy</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">li</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">B</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">的计数器可以使用</span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t()</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri"> </span><span style="font-size:10.0pt;line-height: 116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">方法重置</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">。</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">所以</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">yc</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">li</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:116%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:116%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">r&nbsp; </span><span style="font-size:10.0pt; line-height:116%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">能处理更为复杂的业务场景</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">,</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">比如如果计算发生错误</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">,</span><span style="font-size:10.0pt;line-height:116%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">可以</span><span style="font-size:10.0pt;line-height:116%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">重置计数器</span><span style="letter-spacing: .5pt">,</span><span style="letter-spacing:.45pt">并让线程们重新</span><span style="letter-spacing:.4pt">执行一次</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:.25pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.45pt;line-height: 125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.15pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:-.1pt">4</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.4pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:-5.15pt">)</span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: -5.0pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:-.1pt">CyclicBar</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.05pt">rier</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:-.4pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">还</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">提</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">供</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">其</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">他</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">有</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">用</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">的</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">方</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">法</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-5.15pt">,</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-5.0pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.1pt">比</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.1pt">如</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.75pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:-.05pt">getNu</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.1pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:-.05pt">ber</span><span lang="EN-US" style="font-size: 10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.1pt">W</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.05pt">aiting</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:-.4pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">方</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">法</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">可</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">以</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">获</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.75pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.1pt">得</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">yc</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">li</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">B</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">阻塞的线程数量</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ke</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">方法用来知道阻塞的线程是</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">否被中断</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">。</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">如果被中断</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.2pt">返回</span><span style="letter-spacing: .15pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height: 125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">tr</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">e </span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">否则返回</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">fa</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">lse</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:124%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">13</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-4.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">synchronized</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">的作用?</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.45pt;margin-right:.25pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">在</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">中</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.8pt">,</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">yn</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">ed</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">关键字是用来控制线程同步的</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.8pt">,</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">就是在多线程的环境下</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.75pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">控制</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">yn</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">代码段不被多个线程同时执行。</span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">yn</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ed</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">既可以加在一段代码上</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">也可以</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">加在方</span><span style="letter-spacing: .3pt">法上</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">14</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-3.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">volatile</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">关键字的作用</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.45pt;margin-right:.35pt;margin-bottom: 0cm;margin-left:1.55pt;margin-bottom:.0001pt;text-indent:-.5pt;line-height: 126%"><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">对于可见性</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">&nbsp; </span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">提供了</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">v</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">il</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .6pt">关键字来保证可见性</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">。</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">当一个共享变量被</span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">v</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">il</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">修饰</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">时</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.4pt">它</span><span style="letter-spacing:.35pt">会保证修改的值会立即被更新到主存</span><span style="letter-spacing: .45pt">,</span><span style="letter-spacing:.35pt">当有其他线程需要读取时</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">它会去内存中读取</span><span lang="EN-US"><o:p></o:p></span></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection6"> <p class="MsoNormal" style="margin-top:2.75pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">新值。从实践角度而言,</span><span lang="EN-US" style="font-size: 10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">vo</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">il</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">的一个重要作用就是和</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">结</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">合</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">保证了原子性</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">详细的</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">可以参见</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ava</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">.</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">il</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">en</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t.</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">m</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">包下的类</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">比如</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">g</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">r</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">15</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.85pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是</span><span style="font-size:14.0pt;line-height:98%;font-family: 宋体;mso-bidi-font-family:宋体"> </span><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">CAS</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.5pt;text-indent:1.15pt;line-height:14.0pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">A</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">S</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">是</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">m</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">pa</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">and</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">w</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">ap</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.45pt">的缩写</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">即我们所说的比较交换</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.2pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 122%"><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.3pt">cas</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">是一种基于锁的操作</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">而且是</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">乐观锁</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">在</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">中锁分为乐观锁和悲观锁</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">。</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">悲观锁是将</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">资源锁住,等一个之前获得锁</span><span style="letter-spacing:.35pt">的线程释放锁之后</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">下一个线程才可以访问</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.35pt">而乐观锁采取了</span> <span style="letter-spacing:.2pt">一种宽泛的态度</span><span style="letter-spacing:.25pt">,</span><span style="letter-spacing:.2pt">通过某种方式不加锁来处理资源</span><span style="letter-spacing:.25pt">,</span><span style="letter-spacing:.2pt">比如通过给记录加</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.1pt">v</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">rsion&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.15pt">来获取数据</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">性能较悲观</span><span style="letter-spacing: .4pt">锁有很大的提高</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.15pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:122%"><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">操作包含三个操作数</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">——</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">内存位置(</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">V</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">)、</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">预期原值(</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">A</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.55pt">)</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">和新值</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">)</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"> </span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">如果内存地址</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">里面</span><span style="letter-spacing:.45pt">的值和</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">的值是一样的</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">那么就将内存里面的值更新成</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">是通过无限循环来获</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">取数据的,若果在第一轮循环中,</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp;</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">线程获取地址里面的值被</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">b</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">线程修改了,那么</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">线程</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">需要自旋</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">到下次循环才有可能机</span><span style="letter-spacing:.4pt">会执行</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.05pt;text-indent:.45pt;line-height: 13.95pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">j</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.45pt">ava</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">.</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.5pt">u</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">il</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">.</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">on</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">u</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">rr</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.45pt">n</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">.</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">o</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.7pt">m</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.35pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">包</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">下</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">的</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">类</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">大</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">多</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">是</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">使</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">用</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.65pt">&nbsp;&nbsp; </span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.45pt">C</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">A</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">S</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">操</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">作</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">来</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">实</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.9pt">现</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.65pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.9pt">的</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.65pt;text-indent:1.35pt;line-height: 13.95pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.2pt">A</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">I</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">ege</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">A</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">Boo</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">ean</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">A</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">cL</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt">ong</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.7pt;line-height:92%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">16</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:92%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:92%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">CAS</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:92%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">的问题</span><span lang="EN-US" style="font-size:14.0pt;line-height:92%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.35pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">1</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">CA</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">容易造成</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ABA</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">问题</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.45pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">一个线</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">程</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">将数值改成了</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">b</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">接着又改成了</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">此时</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">认为是没有变化</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">其实是已经变</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">化过了</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.4pt">而这个问题的解决方案可以使用版本号标识</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.4pt">每操作一次</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">ve</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">加</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">1 </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">在</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ava5</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">中,已经提供了</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">cSt</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">Re</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">f</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">en</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">来解决问题</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:108%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)不能保</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">证代码块的原子性</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.6pt;margin-right:2.85pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:123%"><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.4pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .65pt">机制所保证的知识一个变量的原子性</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">操作</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">而不能保证整个代码块的原子性</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">。</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">比如需</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">要保证</span><span style="letter-spacing: .35pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height: 123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">3</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">个变量共同进行原子性的更新</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">就不得不使用</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">yn</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">z</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">了</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.7pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">S</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">造成</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">利用率增加</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.35pt;margin-right:2.8pt;margin-bottom: 0cm;margin-left:1.2pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">之前说过了</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.4pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">里面是一个循环判断的过程</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">如果线程一直没有获取到状态</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">pu</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">资源会</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">一直被占用</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:120%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:120%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.7pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">17</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-3.9pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">什么是</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">Future</span></b><span style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">?</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.15pt;margin-right:2.4pt;margin-bottom: 0cm;margin-left:.85pt;margin-bottom:.0001pt;text-indent:.15pt;line-height:122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">在并发编程中,我们经常用到非阻塞的模型,在之前的多线程</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">的三种实现中</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">不管是继承</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">类还是实现</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">unnab</span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">接口,都无法保证获取到之</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">前的执行结果</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">通过实现</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">ll</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ba</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">k</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"> </span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">接</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">口</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">并用</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Fu</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">可以来接收多线程的执行结果</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection7"> <p class="MsoNormal" style="margin-top:2.75pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:125%"><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Fu</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">表示一个可能还没有完成的异步任务的结果,针对这个结果可</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">以添加</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Ca</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ba</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">k</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">以便</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">在任务执行成功或失败后作出相应的操作</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:136%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:90%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">18</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:90%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.85pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:90%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是</span><span style="font-size:14.0pt;line-height:90%;font-family: 宋体;mso-bidi-font-family:宋体"> </span><b><span lang="EN-US" style="font-size:14.0pt; line-height:90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">AQS</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.9pt;margin-right:2.95pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:-.2pt;line-height: 126%"><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">是</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Abu</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ac</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Sy</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ze</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">的简称</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">它是一个</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">提高的底层</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">同步工具类</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">用一</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">个</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">类型的变量表示同步状态,并提供了一系列的</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">CA</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">操作</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">来管理这个同步状态</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:102%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 120%"><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">是一个用来构建锁和同步器</span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">的框架</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">使用</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">S&nbsp; </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">能简单且高效地构造出应用广泛的大量</span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.05pt">的</span>同步器<span style="letter-spacing:.05pt">,</span>比如我们提到的<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri">ReentrantLock</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">,</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">Semaphore</span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">,</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体">其他的诸如<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">ReentrantReadWriteLock</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">,</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">Synch</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">onou</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">Q</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ueue</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt"> </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">F</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">eTa</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">k&nbsp; </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">等等皆是基于</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">Q</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">S&nbsp; </span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">的</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.7pt;line-height:90%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">19</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:14.0pt; line-height:90%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-1.6pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:90%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">AQS</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 90%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:90%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">支持两种同步方式<span style="letter-spacing:-1.6pt">:</span></span><span lang="EN-US" style="font-size:14.0pt;line-height:90%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.65pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">独占式</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.6pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">共享式</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.95pt;margin-right:.45pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">这样方便使用者实现不同类型的同步组件</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">独占式如</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">R</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ee</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">tra</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">tL</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ck</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">共享式如</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">Se</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">m</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">pho</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">re</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">Coun</span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">D</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">nLa</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ch</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">,组</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">合</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">式</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">的</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">如</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">Reen</span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.1pt">tr</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Read</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">W</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">rit</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">eLoc</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">k </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.3pt">。</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .25pt">总之</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">AQ</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">S&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">为使用提供了底层</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">支撑</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">如何组装实现</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">使用者</span><span style="letter-spacing:.4pt">可以自由发挥</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">20</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-3.65pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">ReadWriteLock</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">是什么</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.5pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.2pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">首先明确一下,不是说</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">不好,只是</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">某</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">些时候有局限</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">。</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">如果使</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">用</span><span style="letter-spacing: .3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">可能本身是为了防止线程</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">在写数据</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">、</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">线程</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">在读数据造成的数据不</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.65pt">一致</span><span style="letter-spacing:.75pt">,</span><span style="letter-spacing:.65pt">但这样</span><span style="letter-spacing:.75pt">,</span><span style="letter-spacing:.65pt">如</span><span style="letter-spacing:.6pt">果线程</span><span style="letter-spacing:.4pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.3pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .6pt">在读数据</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.75pt">、</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">线程</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">D</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">也在读数据</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.75pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">读数据是不会改变数据的</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.75pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.65pt">没有必要加锁</span><span style="letter-spacing: .4pt"> </span><span style="letter-spacing:.75pt">,</span><span style="letter-spacing:.65pt">但是还是加锁了</span><span style="letter-spacing:.4pt"> </span><span style="letter-spacing:.75pt">,</span> <span style="letter-spacing:.65pt">降低了程序的性</span><span style="letter-spacing:.6pt">能</span><span style="letter-spacing:.4pt"> </span><span style="letter-spacing:.75pt">。</span> <span style="letter-spacing:.6pt">因为这个</span><span style="letter-spacing:.4pt"> </span><span style="letter-spacing:.75pt">,</span><span style="letter-spacing:.6pt">才诞生了读写锁</span> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">ReadWriteLock&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.65pt">&nbsp; </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">ReadWriteLock&nbsp;&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体">是 一 个 读 写 锁 接 口 <span style="letter-spacing:-.05pt">,</span><span lang="EN-US" style="letter-spacing: -.65pt">&nbsp; </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">ReentrantReadWriteLock&nbsp;&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体">是 </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Read</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.45pt">W</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">k</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">接口的一个具体实现</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">实现了读写的分离</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">读锁</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">是共享的</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">写锁是独占的</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">读和读之间不会互斥</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">读</span><span style="letter-spacing:.45pt">和写</span><span style="letter-spacing:.55pt">、</span><span style="letter-spacing:.45pt">写和读</span><span style="letter-spacing:.55pt">、</span><span style="letter-spacing:.45pt">写和写之间才会互斥</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">提升了读写的性能</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">21</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-4.1pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">FutureTask</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">是什么</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.5pt;margin-right:3.2pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">这个其实前面有提到过</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">F</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">eTask</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">表示一个异步运算的任务</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">F</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">eT</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ask&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">里面可以传入一</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.6pt">个</span><span style="letter-spacing:.35pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ll</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">b</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">的具体实现类,可以对这个异步运算的任务的结果进行等待</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">获取</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">、</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">判断是否已</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.6pt">经</span><span style="letter-spacing:.55pt">完成</span><span style="letter-spacing:.65pt">、</span><span style="letter-spacing:.55pt">取消任务等操作</span><span style="letter-spacing:.4pt"> </span><span style="letter-spacing:.65pt">。</span><span style="letter-spacing:.55pt">当然</span><span style="letter-spacing:.65pt">,</span> <span style="letter-spacing:.55pt">由于</span><span style="letter-spacing:.4pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">F</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">eT</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ask</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">也是</span><span style="font-size:10.0pt;line-height:123%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">Runn</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">b</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">接口的实现类</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">所以</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">F</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">eTask</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">也可以放</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">入线程池中</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:124%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:124%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">22</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">&nbsp;</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-3.6pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">synchronized</span></b><span lang="EN-US" style="font-size:14.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt">&nbsp; </span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">和</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt">ReentrantLock</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">的区别</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection8"> <p class="MsoNormal" style="margin-top:2.75pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:120%"><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">synch</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">zed</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">是和</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">if </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">、</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">se</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">、</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">f</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">r </span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">、</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">il</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">一样的关键字</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">Reen</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">tr</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">Lo</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ck&nbsp; </span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">是类</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">这是二者的本</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">质区别。既然</span><span style="letter-spacing: .2pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">Reen</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">tr</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">tL</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">是类,那么它就提供了比</span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">syn</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ed</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">更多更灵活的特性</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height: 120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">可</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">以被继承</span><span style="letter-spacing: .5pt">、</span><span style="letter-spacing:.45pt">可以有方法</span><span style="letter-spacing:.5pt">、</span><span style="letter-spacing:.45pt">可以有各种各样的类变量</span><span style="letter-spacing:.5pt">,</span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">tr</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">tL</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">k</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">比</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">sy</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">iz</span><span lang="EN-US" style="font-size:10.0pt;line-height:120%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ed</span><span lang="EN-US" style="font-size:10.0pt; line-height:120%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:120%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">的扩展</span><span style="font-size:10.0pt;line-height:120%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">性</span><span style="letter-spacing: .35pt">体现在几点上</span><span style="letter-spacing:.45pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:15.15pt;text-indent:1.6pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">tr</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">tL</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">k</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">可以对获取锁的等待时间进行设置</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">这样就避免了</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">死锁</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">k&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">可以获取各种锁的信息</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">Reen</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">an</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">可以</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">灵活地实现多路通知</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:.45pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.25pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">另外,二者的锁机制其实也是不一样的。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">R</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">een</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">tr</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Lock</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">底层调用的</span><span style="font-size:10.0pt;line-height:123%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">是</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">nsa</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">f</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">的</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">pa</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">k&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">方法</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">加锁,</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ynch</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">操作的应该是对象头中</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">k</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">d</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt"> </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">这点我不能确定</span><span style="font-size:10.0pt;line-height:123%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">23</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.2pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是乐观锁和悲观锁</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.3pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .25pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.25pt">乐观</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">锁</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">:</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.65pt;margin-right:1.05pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">就像它的名字一样,对于并发</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">间操作产生的线程安全问题持乐观状态</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">乐观锁认为竞争不总</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.55pt">是会发生</span><span style="letter-spacing: .6pt">,</span><span style="letter-spacing:.55pt">因此它不需要持有锁</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.55pt">将比较</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">-</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.55pt">替换这两个动作作为一个原子操作尝试去修改内</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">存中的变量</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.5pt">如果失</span><span style="letter-spacing:.45pt">败则表示发生冲突</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">那么就应该有相应的重试逻辑</span><span style="letter-spacing: .55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .25pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.25pt">悲观</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">锁</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">:</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.55pt;margin-right:.7pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.2pt;line-height: 119%"><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">还是像它的名字一样,对于并发间</span><span style="font-size:10.0pt; line-height:119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">操作产生的线程安全问题持悲观状态</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:119%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">悲观锁认为竞争总</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">是会发生</span><span style="letter-spacing: .4pt">,</span><span style="letter-spacing:.35pt">因此每次对某资源进行操作时</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">都会持有一个独占的锁</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">就像</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">yn</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ch</span><span lang="EN-US" style="font-size:10.0pt; line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height: 119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">不</span><span style="font-size:10.0pt;line-height:119%; font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">管三七二十一</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">直接上了锁就操</span><span style="letter-spacing:.4pt">作资源了</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:136%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.3pt;line-height:91%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">24</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-1.7pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:91%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程</span><span style="font-size:14.0pt;line-height:91%;font-family: 宋体;mso-bidi-font-family:宋体"> </span><b><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">B</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">怎么知道线程</span><span style="font-size:14.0pt;line-height:91%;font-family: 宋体;mso-bidi-font-family:宋体"> </span><b><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">A</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">修改了变量</span><span lang="EN-US" style="font-size:14.0pt;line-height:91%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.75pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">il</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.4pt">修饰变</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">量</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">sy</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">iz</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">ed</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">修饰修改变量的方法</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.4pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.25pt">w</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">/</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt">no</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">fy</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">4</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.3pt">w</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">h</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.1pt">il</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">e&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.35pt">轮询</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">25</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-3.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">synchronized</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-3.35pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">volatile</span></b><span lang="EN-US" style="font-size:14.0pt;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-3.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">CAS</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">比较</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.45pt;text-indent:1.6pt;line-height:31.2pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-15.0pt;mso-text-raise:15.0pt; letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .3pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.55pt">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.25pt">s</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">y</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .25pt">h</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.2pt">ze</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.4pt">是悲观锁</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.55pt">,</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.4pt">属于抢占式</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.55pt">,</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.4pt">会引起其他线程阻塞</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.6pt;line-height:14.0pt;mso-line-height-rule: exactly"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">)</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">vo</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">il</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">提供多线程共享变量可见性和禁止指令重排</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt; mso-text-raise:.5pt;letter-spacing:.4pt">序优化</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection9"> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">CA</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">是基于冲突检测的乐观锁(</span><span style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">非阻塞</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">26</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-1.95pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">sleep</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">方法和</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt">wait</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">方法有什么区别</span><b><span lang="EN-US" style="font-size:14.0pt;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt">?</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.5pt;margin-right:1.85pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">这个问题常问</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.7pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.4pt">eep</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .65pt">方法和</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .45pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">t&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .6pt">方法都可以用来放弃</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.4pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">一定的时间</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">不同点在于如</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">果线程持有某个对象的监视器,</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ep</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">方法不会放弃这个对象的监视器</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">it</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">方法会放弃这</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">个对象的</span><span style="letter-spacing:.4pt">监视器</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">27</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-2.75pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">ThreadLocal</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">是什么?有什么用?</span><span lang="EN-US" style="font-size:14.0pt;font-family: 宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.4pt;margin-right:0cm;margin-bottom:0cm; margin-left:.75pt;margin-bottom:.0001pt;line-height:121%"><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">T</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ea</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">d</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ca</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">是一个本地线程副本变量工</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">具类</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">主要用于将私有线程和该线程存放的副本对</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">象做一个映射,各个线程之间的变量互不干扰,在高</span><span style="letter-spacing:.4pt">并发场景下</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.4pt">可以实现无状态的调用</span><span style="letter-spacing:.45pt">,</span> <span style="letter-spacing:.35pt">特别适用于各个线程依赖不通的变量值完成操作的场景</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.35pt">简单说</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ead</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Loca</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">就是一种以空</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> 间<span style="letter-spacing:-.1pt"> </span>换<span style="letter-spacing: -.1pt"> </span>时<span style="letter-spacing:-.1pt"> </span>间<span style="letter-spacing:-.1pt"> </span>的<span style="letter-spacing:-.1pt"> </span>做<span style="letter-spacing:-.1pt"> </span>法<span style="letter-spacing:-.1pt"> </span><span style="letter-spacing:-5.0pt">,<span lang="EN-US">&nbsp; </span></span>在<span style="letter-spacing: -.1pt"> </span>每<span style="letter-spacing:-.1pt"> </span>个<span lang="EN-US" style="letter-spacing:-.1pt">&nbsp; </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">Thread<span style="letter-spacing:-.1pt">&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体">里<span style="letter-spacing:-.1pt"> </span>面<span style="letter-spacing: -.1pt"> </span>维<span style="letter-spacing:-.1pt"> </span>护<span style="letter-spacing:-.1pt"> </span>了<span style="letter-spacing:-.1pt"> </span>一<span style="letter-spacing:-.05pt"> </span>个<span style="letter-spacing:-.05pt"> </span>以<span style="letter-spacing:-.05pt"> </span>开<span style="letter-spacing:-.05pt"> </span>地<span style="letter-spacing:-.05pt"> </span>址<span style="letter-spacing:-.05pt"> </span>法<span style="letter-spacing:-.05pt"> </span>实<span style="letter-spacing:-.05pt"> </span>现<span style="letter-spacing:-.05pt"> </span>的 </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt"> L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">l.</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">ead </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">M</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ap </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">把数据进行隔离</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">数据不共享</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">自然就没有线程安全方面的问</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.25pt">题了</span><span style="letter-spacing: .45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:128%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">28</span></b><span lang="EN-US" style="font-size:14.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.15pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、为什么</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.15pt">w</span></b><b><span lang="EN-US" style="font-size:14.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">ait()</span></b><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.15pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">方</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">法和</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.05pt">notify()/notifyAll()</span></b><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;letter-spacing:.1pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">方法要在同步块中被调</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.35pt;line-height: 92%"><span style="font-size:14.0pt;line-height:92%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">用</span><span lang="EN-US" style="font-size:14.0pt;line-height:92%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.65pt;text-indent:1.15pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">这是</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">J</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">DK</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">强制的,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.35pt">w</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">t()</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">方法和</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">no</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">f</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">y</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">()/</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">no</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">f</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">y</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">ll</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">方法在调用前都必须先获得对象的锁</span><span lang="EN-US" style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.3pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">29</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-3.2pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">多线程同步有哪几种方法?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.55pt;text-indent:1.05pt;line-height: 13.95pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">Sy</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">z</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">ed</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">关键字</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.45pt">锁实现</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">分布式锁等</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">30</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.3pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程的调度策略</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.3pt;text-indent:1.2pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">线程调度器选</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">择优先级最高的线程运行</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">但是</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">如果发生以下情况</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">就会终止线程的运行</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">)线程体中调用了</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">y</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">方法让出了对</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">p</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">u</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">的占用权利</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">)线程体中调用了</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">ee</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">方法使线程进入睡眠状态</span><span lang="EN-US" style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">3</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)线程由于</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">O</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">操作受到阻塞</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">4</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)另外一个更高优</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">先级线程出现</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection10"> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">5</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">在支持时间片的系统中</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">该线程的时间片用完</span><span lang="EN-US" style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 19.5pt;mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">31</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-2.9pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">ConcurrentHashMap</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">的并发度是什么</span><span lang="EN-US" style="font-size:14.0pt;font-family: 宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.35pt;margin-right:2.3pt;margin-bottom: 0cm;margin-left:1.3pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 124%"><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Con</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">en</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">H</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">M</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ap</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">的并发度就是</span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">eg</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">en</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">的大小,默认为</span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">1</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">6</span><span style="font-size:10.0pt;line-height: 124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">这意味着最多同时可以有</span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">16</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">条线程操作</span><span style="font-size:10.0pt;line-height: 124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Con</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">en</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ap</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt"> </span><span style="font-size:10.0pt;line-height: 124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,这也是</span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">Con</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">en</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">M</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ap</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">对</span><span style="font-size:10.0pt;line-height:124%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ab</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">的最大优</span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">势</span><span style="letter-spacing: .5pt">,</span><span style="letter-spacing:.45pt">任何情况下</span><span style="letter-spacing:.5pt">,</span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.3pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ab</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">能同时有两条线程获取</span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">h</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ab</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:124%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:124%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">中的数据吗?</span><span lang="EN-US" style="font-size:10.0pt;line-height:124%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:124%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:125%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 19.5pt;mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">32</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">Linux</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">环境下如何查找哪个线程使用</span><span style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt">CPU</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt; mso-text-raise:1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">最长</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.45pt;text-indent:1.6pt;line-height:31.2pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-15.0pt;mso-text-raise:15.0pt; letter-spacing:.3pt">(</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.3pt">获取项目的</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">p</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.2pt">d</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .1pt">&nbsp;</span><span style="font-size: 10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-15.0pt; mso-text-raise:15.0pt;letter-spacing:.35pt">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">p</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.3pt">或者</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">p</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.1pt">&nbsp;-</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .1pt">f </span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.15pt">|</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-15.0pt;mso-text-raise: 15.0pt;letter-spacing:.15pt">gr</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .2pt">ep</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-15.0pt;mso-text-raise:15.0pt;letter-spacing: .05pt">j</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-15.0pt;mso-text-raise:15.0pt;letter-spacing:.1pt">ava</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.6pt;line-height:14.0pt;mso-line-height-rule: exactly"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">2</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt; letter-spacing:.15pt">)</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">top</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">-</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">H</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.05pt">-p</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">pid</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:.1pt">&nbsp;</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.1pt">,</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:.05pt">顺序不能改变</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:1.25pt;line-height:92%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">33</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:92%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:92%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">Java</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 92%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:92%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">死锁以及如何避免?</span><span lang="EN-US" style="font-size:14.0pt;line-height: 92%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.4pt;margin-right:3.15pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.4pt;line-height:125%"><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">v</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">中的死锁是一种编程情况</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">其中两个或多个线程被永久阻塞</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">v</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">死锁情况出</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">现至少</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">两个线程和两个</span><span style="letter-spacing: .4pt">或更多资源</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:.7pt;line-height:94%"><span lang="EN-US" style="font-size:10.0pt;line-height:94%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:94%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:94%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:94%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">发生死锁的根本原因是:在申</span><span style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">请锁时发生了交叉闭环申请</span><span style="font-size:10.0pt; line-height:94%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:94%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:149%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">34</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.4pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">死锁的原因</span><span lang="EN-US" style="font-size:14.0pt;line-height:98%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:111%"><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:111%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">1</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;line-height:111%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">是</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">多个线程涉及到多个锁</span><span style="font-size:10.0pt; line-height:111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">这些锁存在着交叉</span><span style="font-size:10.0pt; line-height:111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">所以可能会导致了一个锁依赖的闭环</span><span style="font-size:10.0pt; line-height:111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">例如</span><span style="letter-spacing: .5pt">:</span><span style="letter-spacing:.4pt">线程在获得了锁</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">并且没有释放的情况下去申请锁</span><span style="font-size:10.0pt;line-height:111%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt"> </span><span style="font-size:10.0pt;line-height: 111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">这时</span><span style="font-size:10.0pt;line-height: 111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">另一个线程已经获得</span><span style="font-size:10.0pt; line-height:111%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">了锁</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height: 111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,在释放锁</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:111%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">之前又要先获得锁</span><span style="font-size:10.0pt;line-height:111%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height: 111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,因此闭环发生,陷入</span><span style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">死锁循环</span><span style="font-size:10.0pt;line-height: 111%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:111%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">默认的锁申请操作是阻塞的</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.65pt;margin-right:3.5pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">所以要避免死锁,就要在一遇到</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">多个对象锁交叉的情况</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">就要仔细审查这几个对象的类中的</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">所有方法,是否存在着导致锁依</span><span style="letter-spacing:.35pt">赖的环路的可能性</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.35pt">总之是尽量避免在一个同步方法中调用</span> <span style="letter-spacing: .45pt">其它对象的延时方法和同</span><span style="letter-spacing:.4pt">步方法</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">35</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.15pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">怎么唤醒一个阻塞的线程</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.65pt;margin-right:2.9pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.2pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">如果线程是因为调用了</span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">t()</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"> </span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">、</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">eep</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">()</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">或</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">者</span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">()</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">方法</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">而导致的阻塞</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">可以中断线程</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">并且</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.25pt">通过抛出</span><span style="letter-spacing: .15pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height: 121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">up</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ted E</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">xc</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">ep</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">ti</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">on&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .2pt">来唤醒它</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">;</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">如果线程遇到了</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">O&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">阻塞</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">无能为力</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">因为</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">I</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">O&nbsp; </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt">是</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">操作系</span><span style="letter-spacing:.45pt">统实现的</span><span style="letter-spacing:.55pt">,</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">代码并没有办法直接接触到操作系统</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection11"> <p class="MsoNormal" style="line-height:166%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">36</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"> </span><span style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-2.95pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">不可变对象对多线程有什么帮助</span><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;margin-right:1.3pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">前面有提到过的一个问</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">题</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">不可变对象保证了对象的内存可见性</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">对不可变对象的读取不需</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">要进行额外的同步手段</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">提升了代码执行效率</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">37</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.1pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是多线程的上下文切换</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.25pt;margin-right:1.15pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.4pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.75pt">多线程的上下文切换是指</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .4pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.5pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.75pt">控制</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.7pt">权由一个已经正在运行的线程切换到另外一个就绪并</span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">等待获取</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">执行权的线程的过程</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 98%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">38</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.8pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">如果你提交任务时<span style="letter-spacing:-.8pt">,</span>线程池队列已满<span style="letter-spacing:-.8pt">,</span>这时会发生什么</span><span lang="EN-US" style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.3pt;text-indent:1.15pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">这</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">里区分一下</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:.8pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">1</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">)</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt">如果使用的是无界队列</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ke</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">d</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">g</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">Qu</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">也就是无界队</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">列的话</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">没关系</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">继续添</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">加任务到阻塞队列中等待执行,因为</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ke</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">d</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">g</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">eu</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">可以近乎认为是一个无穷大的队</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">列</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">可以无限存放</span><span style="letter-spacing:.4pt">任务</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.9pt;margin-right:0cm;margin-bottom: 0cm;margin-left:.85pt;margin-bottom:.0001pt;text-indent:.7pt;line-height:121%"><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.05pt">(</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-5.0pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.05pt">2</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:-.25pt"> </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-5.05pt">)</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-5.0pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">如</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">果</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">使</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">用</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">的</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">是</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">有</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">界</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">队</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">列</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">比</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">如</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt">&nbsp; </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: -.05pt">ArrayBlockingQueue</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:-.25pt"> </span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-5.05pt">,</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-5.0pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">任</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">务</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">首</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">先</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">会</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">被</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">添</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">加</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.5pt"> </span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:-.05pt">到</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ayB</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">k</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">ng</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">Q</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ueue</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp;&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">中</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ayB</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">k</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ng</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Q</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ueue</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">满了</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">会根</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">据</span><span style="font-size:10.0pt;line-height:121%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ax</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">Poo</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">z</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .3pt">的值增加线程</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">数量,如果增加了线程数量还是处理不过来,</span></span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">A</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">rr</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">y</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">ck</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ng</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">Q</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ueue</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">继续满</span><span style="font-size:10.0pt;line-height:121%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">那么则会使用拒</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.25pt">绝策略</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">Re</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">j</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ec</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Execu</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">ti</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">on</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">H</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">an</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">d</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt; line-height:121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">处理满了的任务</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height: 121%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">默认是</span><span style="font-size:10.0pt;line-height:121%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Abo</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">rt</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> Po</span><span lang="EN-US" style="font-size:10.0pt; line-height:121%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">li</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">cy</span><span lang="EN-US" style="font-size:10.0pt;line-height:121%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:138%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:1.25pt;line-height: 91%;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">39</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.8pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:91%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">Java</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">中用到的线程调度算法是什么</span><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.45pt;margin-right:1.2pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">抢占式</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">一个线程用完</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">之后</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">操作系统会根据线程优先级</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">、</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">线程饥饿情况等数据算出</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">一个总的优先级并分配下一个时间片给某个线程执行</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:108%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">40</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-2.8pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">什么是线程调度器</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">(Thread</span></b><span lang="EN-US" style="font-size:14.0pt;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; position:relative;top:-1.5pt;mso-text-raise:1.5pt">&nbsp;<b>Scheduler)</b></span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">和时间分片</span><b><span lang="EN-US" style="font-size:14.0pt;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; position:relative;top:-1.5pt;mso-text-raise:1.5pt">(TimeSlicing)</span></b><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">?</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.55pt;margin-right:.95pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.15pt;line-height: 122%"><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">线程调度器是一个操作系统服务</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">它负责为</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">Runn</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">b</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">l</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">状态的线程分配</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .35pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">时间</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">一旦我</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.65pt">们创建一个线程并启动它,它的执行便依赖于线程调度器的实</span><span style="letter-spacing:.6pt">现</span><span style="letter-spacing:.65pt">。</span><span style="letter-spacing:.6pt">时间分片是指将可用的</span> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">U</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">时间分配给可用的</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.3pt">R</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">unnab</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">线程的过程。分配</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">CPU</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">时间可以基于线程优先级或者线</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">程等待的时间</span><span style="letter-spacing:.5pt">。</span><span style="letter-spacing:.45pt">线程调度并不受到</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">虚拟机控制</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">所以由应用程序来控制它是更好的选</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">择(</span><span style="letter-spacing: .45pt">也就是说不要让你的程序依赖于线程的优先级</span><span style="letter-spacing:.55pt">)。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:134%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:134%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.6pt;text-indent:.95pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">41</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-3.05pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是自旋</span><span lang="EN-US" style="font-size:14.0pt;line-height:98%; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.5pt;text-indent:1.15pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.55pt">很多</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.3pt">&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">sy</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">h</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">on</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">z</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.3pt">ed</span><span lang="EN-US" style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.55pt">里面的代码只是一些很简单的代码</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.55pt">执行时间非常快</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.6pt">,</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.55pt">此时等待</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.5pt">的线程</span><span lang="EN-US" style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection12"> <p class="MsoNormal" style="margin-top:3.1pt;margin-right:3.05pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.15pt;line-height:119%"><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">都加锁可能是一种不太</span><span style="font-size:10.0pt; line-height:119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">值得的操作</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:119%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">因为线程阻塞涉及到用户态和内核态切换的问题</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span style="font-size:10.0pt;line-height:119%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">既然</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">synchronized</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp;&nbsp; </span><span style="font-size: 10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .1pt">里面 的代码执 行得 非常快 ,</span><span style="font-size:10.0pt;line-height:119%; font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.1pt">不妨让等待锁 的线程不要被</span><span style="letter-spacing:.05pt"> </span><span style="letter-spacing: .1pt">阻塞</span><span style="letter-spacing:.05pt"> </span><span style="letter-spacing:.1pt">,</span> <span style="letter-spacing:.1pt">而</span><span style="letter-spacing:.05pt"> </span><span style="letter-spacing:.1pt">是在</span> </span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.2pt">sy</span><span lang="EN-US" style="font-size:10.0pt; line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-size:10.0pt; line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:119%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:119%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">的边界做忙循环,这</span><span style="font-size:10.0pt; line-height:119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">就是自旋</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">。</span><span style="font-size:10.0pt;line-height: 119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">如果做了多次忙循环发现还没有获得锁</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 119%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">再阻</span><span style="font-size:10.0pt;line-height:119%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">塞</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.45pt">这样可能是</span><span style="letter-spacing:.4pt">一种更好的策略</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:126%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:126%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">42</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-.45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">Java</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp;<b>Concurrency</b> <b>API</b>&nbsp; </span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">中的</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.5pt;mso-text-raise:1.5pt">&nbsp;</span><b><span lang="EN-US" style="font-size: 14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise:1.5pt">Lock</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">接口</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">(Lock</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp;<b>interface)</b></span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.5pt;mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">是什么?对</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:2.75pt;line-height: 91%"><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-.2pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">比同</span><span style="font-size:14.0pt;line-height:91%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:-.15pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">步它有什么优势?</span><span lang="EN-US" style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.7pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.3pt;margin-bottom:.0001pt;text-indent:.25pt;line-height:125%"><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">L</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ck</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .55pt">接口比同步方法和同步块提供了更具扩展性的锁操作</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.55pt">他们允许更灵活的结</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">构</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">可以</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">具</span><span style="letter-spacing: .45pt">有完全不同的性质</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">并且可以支持多个相关类的条件对象</span><span style="letter-spacing: .55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.3pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">它的优势</span><span style="font-size:10.0pt;line-height: 95%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">有</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">可以使锁</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">更公平</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">可以使线程在等待锁的时候响应</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">中断</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)可以让线程尝试获取锁,并</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">在无法获取锁的时候立即返回或者等待一段时间</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">4</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">)</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt">可以在不同的范围</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt">,</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.25pt">以不同的顺序</span><span style="letter-spacing:.2pt">获取和释放锁</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:148%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">43</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.85pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">单例模式的线程安全性</span><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.35pt;margin-right:3.5pt;margin-bottom: 0cm;margin-left:1.4pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">老生常谈的问题了,首先</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">要说的是单例模式的线程安全意味着</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">:</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">某个类的实例在多线程环境</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">下只会被创建一次出来</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.45pt">单例模式有很多种的写法</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">我总结一下</span><span style="letter-spacing:.5pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">饿汉式单例模式的</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">写法</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">线程安全</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">2</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">懒汉式单例模式的写法</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">:</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">非线</span><span style="font-size:10.0pt;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">程安全</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:123%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.45pt">双检锁单例模式的</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">写法</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.4pt">线程安全</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">44</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt;letter-spacing:-.05pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt;mso-text-raise: 1.5pt;letter-spacing:-2.6pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.5pt;mso-text-raise:1.5pt">Semaphore</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.5pt;mso-text-raise: 1.5pt">&nbsp; </span><span style="font-size: 14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.5pt; mso-text-raise:1.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">有什么作用</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.55pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.2pt;line-height: 123%"><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Se</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">a</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">pho</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">就是一个信号量,它的作用是限制某段代码</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">块的并发数</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Se</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">pho</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">有一个构造</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">函数</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.4pt">可以传入一个</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">型整数</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">表示某段代码最多只有</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">个线程可以访问</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">如果超出</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">了</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.2pt">n</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">那么请等待</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">等到某个线程执行完毕这段代码块</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">下一个线程再进入</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">由此可以看出</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">如果</span><span style="letter-spacing: .25pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height: 123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Se</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">apho</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">构造函数中传入的</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">i</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .4pt">型整数</span><span style="font-size:10.0pt;line-height:123%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">n=1</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt"> </span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">,相当于变成了一个</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">yn</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">ch</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">on</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">z</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">ed</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.35pt">了</span><span style="font-size:10.0pt;line-height: 123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><p class="MsoNormal" style="margin-top:6.5pt;text-indent:.95pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">45</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-3.2pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">Executors</span></b><span lang="EN-US" style="font-size:14.0pt;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt">&nbsp; </span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">类是什么?</span><span lang="EN-US" style="font-size:14.0pt;font-family:宋体; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:6.4pt;margin-right:1.1pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.45pt;line-height:126%"><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">Executors&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.1pt">为</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">Executor</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.1pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">ExecutorService</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.1pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">Scheduled ExecutorService</span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.1pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">Thread Factory&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.1pt">和</span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">C</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">allable </span><span style="font-size:10.0pt;line-height:126%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">类提供了一些工具方法。</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Exec</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">u</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">rs&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">可以用于方便的创建线程池</span><span lang="EN-US" style="font-size: 10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="line-height:135%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:98%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">46</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:98%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-1.1pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;line-height:98%;font-family:宋体; mso-bidi-font-family:宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程类的构造方法<span style="letter-spacing:-1.1pt">、</span>静态块是被哪个线程调用的</span><span lang="EN-US" style="font-size:14.0pt;line-height:98%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:7.3pt;margin-right:2.8pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">这是一个非常刁钻和狡猾的问题</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">请记住</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.6pt">:</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">线程类的构造方法</span><span style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">、</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">静态块是被</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">n</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">w</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:125%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">这个线程</span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">类所在的线程所调用的,而</span><span style="letter-spacing: .3pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:125%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">un</span><span lang="EN-US" style="font-size:10.0pt;line-height:125%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .5pt">方法里面的代码才</span><span style="font-size:10.0pt;line-height:125%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">是被线程自身所调用的</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-size:10.0pt; line-height:125%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:12.5pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.75pt;margin-bottom:.0001pt;text-indent:-.5pt;line-height: 126%"><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">如果说上面的说法让你感到困惑,那么我举</span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体">个例子<span style="letter-spacing:.05pt">,</span>假设<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">Thread2<span style="letter-spacing:.05pt">&nbsp;&nbsp; </span></span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体">中<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">new<span style="letter-spacing:.05pt">&nbsp; </span></span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体">了<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">Thread<span style="letter-spacing:.05pt"> </span>1</span><span style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">,</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">main </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">函数中</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">new</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">了</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-size:10.0pt;line-height:126%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:126%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.05pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ead2 </span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-size:10.0pt;line-height: 126%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.2pt">那么</span><span style="font-size:10.0pt;line-height:126%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.25pt">:</span><span lang="EN-US" style="font-size:10.0pt; line-height:126%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:13.8pt;margin-right:2.2pt;margin-bottom: 0cm;margin-left:2.15pt;margin-bottom:.0001pt;text-indent:-.55pt;line-height: 114%"><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">1</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">Thread2&nbsp; </span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">的构造方法、静态块是 </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.05pt">main&nbsp; </span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">线程调用的,</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">Thread2&nbsp; </span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">的 </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.05pt">run()</span><span style="font-size:10.0pt;line-height: 114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">方法是 </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .05pt">Thre</span><span lang="EN-US" style="font-size:10.0pt;line-height:114%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">ad2<span style="letter-spacing:.05pt">&nbsp;&nbsp; </span></span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体">自 <span style="letter-spacing:.1pt">己调用的</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:113%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.3pt;margin-right:2.05pt;margin-bottom: 0cm;margin-left:2.15pt;margin-bottom:.0001pt;text-indent:-.55pt;line-height: 114%"><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">2</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">)</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">Thread 1&nbsp; </span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">的构造方法、静态块是 </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Thread2&nbsp; </span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.05pt">调用的,</span><span lang="EN-US" style="font-size:10.0pt; line-height:114%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.05pt">Thread 1&nbsp; </span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">的 </span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family: &quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri; letter-spacing:.05pt">run()</span><span style="font-size:10.0pt;line-height: 114%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.05pt">方法</span><span style="font-size:10.0pt;line-height:114%;font-family:宋体;mso-bidi-font-family: 宋体">是<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:114%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri">Thread<span style="letter-spacing:.05pt"> </span>1<span style="letter-spacing:.05pt">&nbsp;&nbsp; </span></span><span style="font-size:10.0pt; line-height:114%;font-family:宋体;mso-bidi-font-family:宋体">自 <span style="letter-spacing:.1pt">己调用的</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:137%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="line-height:137%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:19.5pt; mso-line-height-rule:exactly;mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">47</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.1pt">&nbsp;</span><span style="font-size:14.0pt; font-family:宋体;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:-1.2pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><span style="font-size:14.0pt;font-family:宋体;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.402pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">同步方法和同步块<span style="letter-spacing:-1.2pt">,</span>哪个是更好的选择</span><b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">?</span></b><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:8.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:1.1pt;line-height:125%"><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">同步块</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">这意味着同</span><span style="font-size:10.0pt;line-height: 125%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">步块之外的代码是异步执行的</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">这比同步整个方法更提升代码的效率</span><span style="font-size:10.0pt;line-height:125%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span style="font-size:10.0pt;line-height:125%; font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">请知道一条原则</span><span style="letter-spacing:.5pt">:</span><span style="letter-spacing:.45pt">同步的范围越小越</span><span style="letter-spacing:.4pt">好</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:4.55pt;text-indent:.95pt;line-height:91%; mso-outline-level:7"><b><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">48</span></b><span lang="EN-US" style="font-size: 14.0pt;line-height:91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:-.05pt"> </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:-2.5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">、</span><b><span lang="EN-US" style="font-size:14.0pt;line-height:91%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri">Java</span></b><span lang="EN-US" style="font-size:14.0pt;line-height: 91%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-size:14.0pt;line-height:91%;font-family:宋体;mso-bidi-font-family: 宋体;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .402pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">线程数过多会造成什么异常?</span><span lang="EN-US" style="font-size:14.0pt; line-height:91%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:8.55pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">1</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">)线程的生命周期</span><span style="font-size:10.0pt; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">开销非常高</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:2.6pt;text-indent:1.6pt;line-height:95%"><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">(</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">2</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.5pt">)</span><span style="font-size:10.0pt;line-height:95%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">消耗过多的</span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">CP</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .3pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:95%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">&nbsp; </span><span style="font-size:10.0pt;line-height:95%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">资源</span><span lang="EN-US" style="font-size:10.0pt; line-height:95%;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:3.2pt;margin-right:2.8pt;margin-bottom: 0cm;margin-left:1.2pt;margin-bottom:.0001pt;line-height:123%"><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">如果可运行的线程数量</span><span style="font-size:10.0pt; line-height:123%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">多于可用处理器的数量</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">那么有线程将会被闲置</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span style="font-size:10.0pt;line-height:123%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.35pt">大量空闲的线程会</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.55pt">占用许多内存</span><span style="letter-spacing: .6pt">,</span><span style="letter-spacing:.55pt">给垃</span><span style="letter-spacing:.5pt">圾回收器带来压力</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">而且大量的线程在竞争</span><span style="letter-spacing:.35pt"> </span></span><span lang="EN-US" style="font-size:10.0pt;line-height:123%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.3pt">CP</span><span lang="EN-US" style="font-size:10.0pt; line-height:123%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.35pt">U</span><span lang="EN-US" style="font-size:10.0pt;line-height:123%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt"> </span><span style="font-size:10.0pt;line-height:123%;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.5pt">资源时还将产生其他</span><span style="font-size:10.0pt;line-height:123%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">性</span><span style="letter-spacing: .3pt">能的开销</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:14.15pt;text-indent:1.6pt"><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">3</span><span style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.4pt">)</span><span style="font-size:10.0pt;font-family:宋体; mso-bidi-font-family:宋体;letter-spacing:.35pt">降低稳定性</span><span lang="EN-US" style="font-size:10.0pt;font-family:宋体;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p> </p><p class="MsoNormal" style="margin-top:2.6pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:-.3pt;line-height:122%"><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">V</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.5pt">M</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .6pt">在可创建线程的数量上存在一个限制</span><span style="font-size:10.0pt;line-height:122%; font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.6pt">这个限制值将随着平台的不</span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">同而不同</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.65pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.55pt">并且承</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">受着多个因素制约,包括</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">V</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.4pt">M</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp;&nbsp; </span><span style="font-size:10.0pt; line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing:.45pt">的启动参数、</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">Th</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ead</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .45pt">构造函数中请求</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">栈的大小</span><span style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-size:10.0pt;line-height: 122%;font-family:宋体;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">以及底层</span> <span style="letter-spacing:.4pt">操作系统对线程的限制等。如果破坏了这些限制,那么可能抛出</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-size: 10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri;letter-spacing:.25pt">O</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .2pt">u</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.25pt">O</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">f</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .25pt">m</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .15pt">yE</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%; font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri;mso-bidi-font-family: Calibri;letter-spacing:.1pt">rr</span><span lang="EN-US" style="font-size:10.0pt; line-height:122%;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-font-family:Calibri; mso-bidi-font-family:Calibri;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:&quot;Calibri&quot;,sans-serif; mso-fareast-font-family:Calibri;mso-bidi-font-family:Calibri;letter-spacing: .1pt">r&nbsp; </span><span style="font-size: 10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family:宋体;letter-spacing: .35pt">异常</span><span style="font-size:10.0pt;line-height:122%;font-family: 宋体;mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-size:10.0pt;line-height:122%;font-family:宋体;mso-bidi-font-family: 宋体"><o:p></o:p></span></p>

上一篇 下一篇

热门资讯