?? threadpools.html
字號:
<?xml version="1.0" encoding="GB2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"><head> <meta http-equiv="Content-Type" content="text/html; charset=GB2312" /> <meta name="keywords" content="electronic commerce, ecommerce, ebusiness, e-business, e-commerce, enterprise software, net economy, Sun Microsystems, Sun Open Net Environment, Sun ONE, internet software" /> <meta name="Description" content="Sun Microsystems, Inc. is delivering Sun ONE e-commerce software and enterprise solutions that enable companies to compete successfully in the Net Economy." /> <meta name="TemplateVersion" content="Sun ONE WDT 2.3.1" /> <meta name="LASTUPDATED" content="10/03/03 09:48:24" /> <meta name="BookTitle" content="Sun Java System Application Server Enterprise Edition 8.1 Administration Guide 2005Q1" /> <title>第 19 章 線程池</title> <link href="catalog.css" tppabs="http://docs.sun.com/source/819-1553/catalog.css" rel="stylesheet" type="text/css" /> <!-- on load bring this window to front --> <script laguage="javascript"> top.window.focus(); </script></head><body text="#000000" link="#594FBF" vlink="#9966cc" alink="#333366" bgcolor="#FFFFFF"><a name="top"> </a><!-- navigation --> <table width="100%" border="0" cellspacing="4" summary="Header navigation table"> <tr><td> <p class="pNavigation"> <a HREF="javascript:if(confirm('http://www.sun.com/software/ \n\n該文件無法用 Teleport Ultra 下載, 因為 它是一個域或路徑外部被設置為它的啟始地址的地址。 \n\n你想在服務器上打開它?'))window.location='http://www.sun.com/software/'" tppabs="http://www.sun.com/software/"> <img SRC="Logo.jpg" tppabs="http://docs.sun.com/source/819-1553/Logo.jpg" alt="Sun logo" valign="bottom" border="0" /></a>      <a href="orb.html" tppabs="http://docs.sun.com/source/819-1553/orb.html">上一頁</a>      <a href="index.html" tppabs="http://docs.sun.com/source/819-1553/index.html">目錄</a>      <a href="logging.html" tppabs="http://docs.sun.com/source/819-1553/logging.html">下一頁</a>      </p> </td></tr> <tr><td valign="top" align="right" bgcolor="#594FBF"> <span class="cBookTitle">Sun Java System Application Server Enterprise Edition 8.1 管理指南 2005Q1</span> </td></tr> </table><!-- end navigation --><blockquote><!-- chapter content --><a name="wp40648"> </a><h2 class="pChapNumber"><span class="cGray">第 19 章</span><br /><a name="wp40650"> </a>線程池</h2><a name="wp40654"> </a><p class="pParagraph">本章介紹如何創建、編輯和刪除線程池。它包含以下各節:</p><div class="pSmartList1"><ul class="pSmartList1"><a name="wp40660"> </a><div class="pSmartList1"><li><a href="threadpools.html#wp40670" tppabs="http://docs.sun.com/source/819-1553/threadpools.html#wp40670">關于線程池</a></li></div><a name="wp40666"> </a><div class="pSmartList1"><li><a href="threadpools.html#wp40732" tppabs="http://docs.sun.com/source/819-1553/threadpools.html#wp40732">有關線程池的管理控制臺任務</a></li></div></ul></div><a name="wp40670"> </a><h2 class="pHeading1"><hr />關于線程池</h2><a name="wp40676"> </a><p class="pParagraph">本節介紹線程池及其在 Application Server 中的工作方式。</p><a name="wp40684"> </a><h3 class="pHeading2">Application Server 中的線程池</h3><a name="wp40686"> </a><p class="pParagraph">Java 虛擬機 (JVM) 可以支持一次執行多個線程。為了提高性能,Application Server 維護了一個或多個線程池。可以將特定的線程池指定給連接器模塊和 ORB。</p><a name="wp40688"> </a><p class="pParagraph">一個線程池可以提供多個連接器模塊和企業 Bean。請求線程處理對應用程序組件的用戶請求。服務器接收到請求時,它會將請求指定給線程池中的空閑線程。該線程執行客戶機的請求并返回結果。例如,如果請求需要使用的系統資源當前正處于忙碌狀態,則線程會在允許請求使用該資源前,等待資源回到空閑狀態。</p><a name="wp40690"> </a><p class="pParagraph">指定為來自應用程序的請求預留的最大線程數和最小線程數。線程池在這兩個值之間動態調整。指定的最小線程池大小將通知服務器為應用程序請求至少分配該大小的預留線程數。可以將線程數增加到所指定的最大線程池大小。</p><a name="wp40692"> </a><p class="pParagraph">如果增加可供進程使用的線程數,則該進程可以同時對更多的應用程序進行響應。</p><a name="wp40696"> </a><p class="pParagraph">通過將 Application Server 線程分到不同的線程池中,可以避免在一個資源適配器或應用程序占用 Application Server 中的所有線程時出現線程不足的情況。</p><a name="wp40732"> </a><h2 class="pHeading1"><hr />有關線程池的管理控制臺任務</h2><div class="pSmartList1"><ul class="pSmartList1"><a name="wp40738"> </a><div class="pSmartList1"><li><a href="threadpools.html#wp40758" tppabs="http://docs.sun.com/source/819-1553/threadpools.html#wp40758">創建線程池</a></li></div><a name="wp40744"> </a><div class="pSmartList1"><li><a href="threadpools.html#wp40828" tppabs="http://docs.sun.com/source/819-1553/threadpools.html#wp40828">編輯線程池</a></li></div><a name="wp40750"> </a><div class="pSmartList1"><li><a href="threadpools.html#wp40890" tppabs="http://docs.sun.com/source/819-1553/threadpools.html#wp40890">刪除線程池</a></li></div></ul></div><a name="wp40758"> </a><h3 class="pHeading2">創建線程池</h3><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp40760"> </a><div class="pSmartList1"><li>在樹組件中,選擇“配置”節點。</li></div><a name="wp40762"> </a><div class="pSmartList1"><li>選擇要配置的實例:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp40764"> </a><div class="pSmartList2"><li>要配置特定的實例,請選擇該實例的配置節點。例如,對于默認實例 <code class="cCode">server</code>,請選擇 <code class="cCode">server-config</code> 節點。</li></div><a name="wp40766"> </a><div class="pSmartList2"><li>要配置所有實例的默認設置,請選擇 <code class="cCode">default-config</code> 節點。</li></div></ol></div><a name="wp40768"> </a><div class="pSmartList1"><li>選擇“線程池”節點。</li></div><a name="wp40772"> </a><div class="pSmartList1"><li>在“當前池”下單擊“新建”。</li></div><a name="wp40774"> </a><div class="pSmartList1"><li>在“線程池 ID”字段中輸入線程池的名稱。</li></div><a name="wp40776"> </a><div class="pSmartList1"><li>在“最小線程池大小”字段中,輸入服務此隊列中的請求的線程池中線程的最小數目。</li></div><a name="wp40778"> </a><p class="pStepParaI1">將此線程池實例化時將預先創建這些線程。</p><a name="wp40780"> </a><div class="pSmartList1"><li>在“最大線程池大小”字段中,輸入服務此隊列中的請求的線程池中線程的最大數目。</li></div><a name="wp40782"> </a><p class="pStepParaI1">這是存在于此線程池中的線程數上限。</p><a name="wp40786"> </a><div class="pSmartList1"><li>在“空閑超時”字段中輸入數值(以秒為單位),超過此時間段之后將從池中刪除空閑線程。</li></div><a name="wp40790"> </a><div class="pSmartList1"><li>在“工作隊列的數目”字段中,輸入由此線程池服務的工作隊列的總數。</li></div><a name="wp40792"> </a><div class="pSmartList1"><li>單擊“確定”。</li></div><a name="wp40794"> </a><div class="pSmartList1"><li>重新啟動 Application Server。</li></div></ol></div><a name="wp40800"> </a><p class="pParagraph">等效的 <code class="cCode">asadmin</code> 命令為:<code class="cCode">create-threadpool</code></p><a name="wp40828"> </a><h3 class="pHeading2">編輯線程池</h3><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp40830"> </a><div class="pSmartList1"><li>在樹組件中,選擇“配置”節點。</li></div><a name="wp40832"> </a><div class="pSmartList1"><li>選擇要配置的實例:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp40834"> </a><div class="pSmartList2"><li>要配置特定的實例,請選擇該實例的配置節點。例如,對于默認實例 <code class="cCode">server</code>,請選擇 <code class="cCode">server-config</code> 節點。</li></div><a name="wp40836"> </a><div class="pSmartList2"><li>要配置所有實例的默認設置,請選擇 <code class="cCode">default-config</code> 節點。</li></div></ol></div><a name="wp40838"> </a><div class="pSmartList1"><li>選擇“線程池”節點。</li></div><a name="wp40842"> </a><div class="pSmartList1"><li>在“當前池”下選擇要更改的線程池的名稱。</li></div><a name="wp40844"> </a><div class="pSmartList1"><li>在“最小線程池大小”字段中,輸入服務此隊列中的請求的線程池中線程的最小數目。</li></div><a name="wp40846"> </a><p class="pStepParaI1">將此線程池實例化時將預先創建這些線程。</p><a name="wp40848"> </a><div class="pSmartList1"><li>在“最大線程池大小”字段中,輸入服務此隊列中的請求的線程池中線程的最大數目。</li></div><a name="wp40850"> </a><p class="pStepParaI1">這是存在于此線程池中的線程數上限。</p><a name="wp40854"> </a><div class="pSmartList1"><li>在“空閑超時”字段中輸入數值(以秒為單位),超過此時間段之后將從池中刪除空閑線程。</li></div><a name="wp40858"> </a><div class="pSmartList1"><li>在“工作隊列的數目”字段中,輸入由此線程池服務的工作隊列的總數。</li></div><a name="wp40860"> </a><div class="pSmartList1"><li>單擊“保存”。</li></div><a name="wp40862"> </a><div class="pSmartList1"><li>重新啟動 Application Server。</li></div></ol></div><a name="wp40890"> </a><h3 class="pHeading2">刪除線程池</h3><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp40892"> </a><div class="pSmartList1"><li>在樹組件中,選擇“配置”節點。</li></div><a name="wp40894"> </a><div class="pSmartList1"><li>選擇要配置的實例:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp40896"> </a><div class="pSmartList2"><li>要配置特定的實例,請選擇該實例的配置節點。例如,對于默認實例 <code class="cCode">server</code>,請選擇 <code class="cCode">server-config</code> 節點。</li></div><a name="wp40898"> </a><div class="pSmartList2"><li>要配置所有實例的默認設置,請選擇 <code class="cCode">default-config</code> 節點。</li></div></ol></div><a name="wp40900"> </a><div class="pSmartList1"><li>選擇“線程池”節點。</li></div><a name="wp40904"> </a><div class="pSmartList1"><li>在“當前池”表中選取要刪除的線程池名稱。</li></div><a name="wp40906"> </a><div class="pSmartList1"><li>單擊“刪除”。</li></div><a name="wp40908"> </a><div class="pSmartList1"><li>重新啟動 Application Server。</li></div></ol></div><a name="wp40914"> </a><p class="pParagraph">等效的 <code class="cCode">asadmin</code> 命令為:<code class="cCode">delete-threadpool</code></p><a name="wp40936"> </a><p class="pParagraph"></p><!-- end chapter content --><!-- footer --><!-- navigation --><br /><br /> <table width="100%" border="0" cellspacing="4" summary="Footer navigation table"> <tr><td> <p class="pNavigation"> <a href="orb.html" tppabs="http://docs.sun.com/source/819-1553/orb.html">上一頁</a>      <a href="index.html" tppabs="http://docs.sun.com/source/819-1553/index.html">目錄</a>      <a href="logging.html" tppabs="http://docs.sun.com/source/819-1553/logging.html">下一頁</a>      </p> </td></tr> </table><!-- end navigation --><hr size="1" noshade="-1" /><!-- copyright --><p class="pFooter"> <!-- start copyright --><span class="footer"><a href="copyright.html" tppabs="http://docs.sun.com/source/819-1553/copyright.html" class="footer">版權所有</a> 2004 - 2005 <a href="javascript:if(confirm('http://sun.com/ \n\n該文件無法用 Teleport Ultra 下載, 因為 它是一個域或路徑外部被設置為它的啟始地址的地址。 \n\n你想在服務器上打開它?'))window.location='http://sun.com/'" tppabs="http://sun.com/" class="footer">Sun Microsystems, Inc.</a> 保留所有權利。</span><!-- end copyright --></p><!-- end copyright --><!-- <p class="pFooter" align="right">Last Updated <b>$Update;</b></p> --><!-- end footer --></blockquote></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -