ΪʲôҪʹÓÃÏ̳߳أ¿
2018-10-24 08:45:06À´Ô´£º²©¿ÍÔ° ÔĶÁ ()
ΪÁ˼õÉÙ´´½¨ºÍÏú»ÙÏ̵߳ĴÎÊý£¬ÈÃÿ¸öÏ߳̿ÉÒÔ¶à´ÎʹÓÃ,¿É¸ù¾ÝϵͳÇé¿öµ÷ÕûÖ´ÐеÄÏß³ÌÊýÁ¿£¬·ÀÖ¹ÏûºÄ¹ý¶àÄÚ´æ,ËùÒÔÎÒÃÇ¿ÉÒÔʹÓÃÏ̳߳Ø.
javaÖÐÏ̳߳صĶ¥¼¶½Ó¿ÚÊÇExecutor(e¿Érai kei ter)£¬ExecutorServiceÊÇExecutorµÄ×ÓÀ࣬ҲÊÇÕæÕýµÄÏ̳߳ؽӿڣ¬ËüÌṩÁËÌá½»ÈÎÎñºÍ¹Ø±ÕÏ̳߳صȷ½·¨¡£µ÷ÓÃsubmit·½·¨Ìá½»ÈÎÎñ»¹¿ÉÒÔ·µ»ØÒ»¸öFuture(fei Çú¶ù)¶ÔÏó£¬ÀûÓøöÔÏó¿ÉÒÔÁ˽âÈÎÎñÖ´ÐÐÇé¿ö£¬»ñµÃÈÎÎñµÄÖ´Ðнá¹û»òÈ¡ÏûÈÎÎñ¡£
ÓÉÓÚÏ̳߳صÄÅäÖñȽϸ´ÔÓ£¬JavaSEÖж¨ÒåÁËExecutorsÀà¾ÍÊÇÓÃÀ´·½±ã´´½¨¸÷ÖÖ³£ÓÃÏ̳߳صŤ¾ßÀࡣͨ¹ýµ÷Óøù¤¾ßÀàÖеķ½·¨ÎÒÃÇ¿ÉÒÔ´´½¨µ¥Ï̳߳Ø(newSingleThreadExecutor),¹Ì¶¨ÊýÁ¿µÄÏ̳߳Ø(newFixedThreadPool)£¬¿É»º´æÏ̳߳Ø(newCachedThreadPool),´óСÎÞÏÞÖƵÄÏ̳߳Ø(newScheduledThreadPool),±È½Ï³£ÓõÄÊǹ̶¨ÊýÁ¿µÄÏ̳߳غͿɻº´æµÄÏ̳߳Ø,¹Ì¶¨ÊýÁ¿µÄÏ̳߳ØÊÇÿÌá½»Ò»¸öÈÎÎñ¾ÍÊÇÒ»¸öỊ̈߳¬Ö±µ½´ïµ½Ï̳߳صÄ×î´óÊýÁ¿£¬È»ºóºóÃæ½øÈëµÈ´ý¶ÓÁÐÖ±µ½Ç°ÃæµÄÈÎÎñÍê³É²Å¼ÌÐøÖ´ÐÐ.¿É»º´æÏ̳߳ØÊǵ±Ï̳߳شóС³¬¹ýÁË´¦ÀíÈÎÎñËùÐèµÄỊ̈߳¬ÄÇô¾Í»á»ØÊÕ²¿·Ö¿ÕÏУ¨Ò»°ãÊÇ60ÃëÎÞÖ´ÐУ©µÄỊ̈߳¬µ±ÓÐÈÎÎñÀ´Ê±£¬ÓÖÖÇÄܵÄÌí¼ÓÐÂÏß³ÌÀ´Ö´ÐÐ.
ExecutorsÀàÖл¹¶¨ÒåÁ˼¸¸öÏ̳߳ØÖØÒªµÄ²ÎÊý,±ÈÈç˵int corePoolSizeºËÐijصĴóС,Ò²¾ÍÊÇÏ̳߳ØÖлáά³Ö²»±»ÊͷŵÄÏß³ÌÊýÁ¿.int maximumPoolSizeÏ̳߳صÄ×î´óÏß³ÌÊý£¬´ú±íÕâÏ̳߳ػã×ÜÄÜ´´½¨¶àÉÙÏ̡߳£corePoolSize :ºËÐÄÏß³ÌÊý£¬Èç¹ûÔËÐеÄÏß³ÌÊýÉÙcorePoolSize£¬µ±ÓÐеÄÈÎÎñ¹ýÀ´Ê±»á´´½¨ÐµÄÏß³ÌÀ´Ö´ÐÐÕâ¸öÈÎÎñ£¬¼´Ê¹Ï̳߳ØÖÐÓÐÆäËûµÄ¿ÕÏеÄÏ̡߳£maximumPoolSize:Ï̳߳ØÖÐÔÊÐíµÄ×î´óÏß³ÌÊý.
±êÇ©£º
°æȨÉêÃ÷£º±¾Õ¾ÎÄÕ²¿·Ö×ÔÍøÂ磬ÈçÓÐÇÖȨ£¬ÇëÁªÏµ£ºwest999com@outlook.com
Ìرð×¢Ò⣺±¾Õ¾ËùÓÐתÔØÎÄÕÂÑÔÂÛ²»´ú±í±¾Õ¾¹Ûµã£¬±¾Õ¾ËùÌṩµÄÉãÓ°ÕÕƬ£¬²å»£¬Éè¼Æ×÷Æ·£¬ÈçÐèʹÓã¬ÇëÓëÔ×÷ÕßÁªÏµ£¬°æȨ¹éÔ×÷ÕßËùÓÐ
ÉÏһƪ£ºspring-AOP£¨ÃæÏòÇÐÃæ±à³Ì)-xml·½Ê½ÅäÖÃ
ÏÂһƪ£ºJNI ¼Ç
- Ϊʲô°¢Àï°Í°ÍJava¿ª·¢ÊÖ²áÖв»ÔÊÐíħ·¨Öµ³öÏÖÔÚ´úÂëÖУ¿ 2020-06-09
- ¼ÆËã»ú»ù´¡µ½µ×ÊÇÄÄЩ»ù´¡£¿ÎªÊ²Ã´ºÜÖØÒª£¡ 2020-06-08
- ×îÏêϸµÄjava¶àÏ̳߳̽ÌÀ´ÁË 2020-06-08
- ϵͳ»¯Ñ§Ï°¶àÏß³Ì(Ò») 2020-06-08
- ÁÄÁÄ OAuth 2.0 µÄ token expire_in ʹÓà 2020-06-08
IDC×ÊѶ£º Ö÷»ú×ÊѶ ×¢²á×ÊѶ ÍйÜ×ÊѶ vps×ÊѶ ÍøÕ¾½¨Éè
ÍøÕ¾ÔËÓª£º ½¨Õ¾¾Ñé ²ß»®Ó¯Àû ËÑË÷ÓÅ»¯ ÍøÕ¾Íƹã Ãâ·Ñ×ÊÔ´
ÍøÕ¾ÁªÃË£º ÁªÃËÐÂÎÅ ÁªÃ˽éÉÜ ÁªÃ˵ãÆÀ Íø׬¼¼ÇÉ
ÐÐÒµ×ÊѶ£º ËÑË÷ÒýÇæ ÍøÂçÓÎÏ· µç×ÓÉÌÎñ ¹ã¸æ´«Ã½
ÍøÂç±à³Ì£º Asp.Net±à³Ì Asp±à³Ì Php±à³Ì Xml±à³Ì Access Mssql Mysql ÆäËü
·þÎñÆ÷¼¼Êõ£º Web·þÎñÆ÷ Ftp·þÎñÆ÷ Mail·þÎñÆ÷ Dns·þÎñÆ÷ °²È«·À»¤
Èí¼þ¼¼ÇÉ£º ÆäËüÈí¼þ Word Excel Powerpoint Ghost Vista QQ¿Õ¼ä QQ FlashGet ѸÀ×
ÍøÒ³ÖÆ×÷£º FrontPages Dreamweaver Javascript css photoshop fireworks Flash
³ÌÐòÉè¼Æ£º Java¼¼Êõ C/C++ VB delphi
- Photoshop»æÖÆÁ¢Ìå·ç¸ñµÄ΢Ц±íÇé
- PSÎÄ×ÖÌØЧ½Ì³Ì£ºÖÆ×÷¹«Â·ÉϸöÐÔµÄÍ¿Ñ»
- PhotoshopÉè¼Æ¾í±ßЧ¹ûµÄ±äÐνð¸ÕµçÓ°
- PSÉ«²ÊÐÞ¸´½Ì³Ì£ºÀûÓÃÉ«½×¹¤¾ß¿ìËÙ¸øºì
- PS°ë͸Ã÷ÎïÌå¿Ùͼ£ºÀûÓÃͨµÀÑ¡Çø¹¤¾ß¿Ù
- PSº£±¨Éè¼Æ¼¼Çɽ̳̣ºÑ§Ï°ÖÆ×÷¸öÐԵč
- PSͼƬÌØЧÖÆ×÷½Ì³Ì£ºÑ§Ï°¸øÌúËþͼƬÖÆ
- ѧϰÓÃphotoshop°Ñ»ë×ǵĺ£Ë®ÕÕƬºóÆÚ
- PS¹Å·çÕÕƬ½Ì³Ì£º¸ø¹Å·çÃÀÅ®´òÔì³öÅ®ÏÀ
- PS¸öÐÔÈËÎﺣ±¨ÖÆ×÷£ºÉè¼Æ´´ÒâʱÉеIJ£
- ʲôÈí¼þ¿ÉÒÔµÁȡ΢ÐźÅÃÜÂë,ÔõôµÁ±ð
- ´ÅÁ¦ËÑË÷ÍøÕ¾µ¼º½2020Äê¸üÐÂ
- springcloudѧϰ֮·: (Ò») ×î¼òµ¥µÄ´î
- ´´½¨Gradle¹¤³Ì³öÏÖCould not install
- ³¹µ×Ū¶®¡°PKIX path building failed
- TomcatÆô¶¯±¨´í:org.apache.catalina.L
- spring boot ´íÎó£ºCheck your ViewRes
- »ùÓÚHttpClientµÄаæÕý·½½ÌÎñϵͳģÄâ
- Ö»ÓгÌÐòÔ±²ÅÄÜ¿´¶®µÄ³µÅÆ£¬¶®µÃ×ÔÈ»¶®
- mybatis ×¢½â@Results¡¢@Result¡¢@Resu