Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaỊ̈߳ºÐÂÌØÕ÷ ÕÏ°­Æ÷

JavaỊ̈߳ºÐÂÌØÕ÷-ÕÏ°­Æ÷
 
Java5ÖУ¬Ìí¼ÓÁËÕÏ°­Æ÷À࣬ΪÁËÊÊÓ¦Ò»ÖÖеÄÉè¼ÆÐèÇ󣬱ÈÈçÒ»¸ö´óÐ͵ÄÈÎÎñ£¬³£³£ÐèÒª·ÖÅäºÃ¶à×ÓÈÎÎñÈ¥Ö´ÐУ¬Ö»Óе±ËùÓÐ×ÓÈÎÎñ¶¼Ö´ÐÐÍê³Éʱºò£¬²ÅÄÜÖ´ÐÐÖ÷ÈÎÎñ£¬Õâʱºò£¬¾Í¿ÉÒÔÑ¡ÔñÕÏ°­Æ÷ÁË¡£
 
ÕÏ°­Æ÷ÊǶàÏ̲߳¢·¢¿ØÖƵÄÒ»ÖÖÊֶΣ¬Ó÷¨ºÜ¼òµ¥¡£ÏÂÃæ¸ø¸öÀý×Ó£º
 
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
/**
* JavaỊ̈߳ºÐÂÌØÕ÷-ÕÏ°­Æ÷
*
* @author leizhimin 2009-11-6 10:50:10
*/
public class Test {
        public static void main(String[] args) {
                //´´½¨ÕÏ°­Æ÷£¬²¢ÉèÖÃMainTaskΪËùÓж¨ÊýÁ¿µÄÏ̶߳¼´ïµ½ÕÏ°­µãʱºòËùÒªÖ´ÐеÄÈÎÎñ(Runnable)
                CyclicBarrier cb = new CyclicBarrier(7, new MainTask());
                new SubTask("A", cb).start();
                new SubTask("B", cb).start();
                new SubTask("C", cb).start();
                new SubTask("D", cb).start();
                new SubTask("E", cb).start();
                new SubTask("F", cb).start();
                new SubTask("G", cb).start();
        }
}
/**
* Ö÷ÈÎÎñ
*/
class MainTask implements Runnable {
        public void r


Ïà¹ØÎĵµ£º

JavaỊ̈߳ºÏß³Ì״̬µÄת»»

JavaỊ̈߳ºÏß³Ì״̬µÄת»»
 
SCJP5ѧϰ±Ê¼Ç
 
Ò»¡¢Ïß³Ì״̬
 
Ï̵߳Ä״̬ת»»ÊÇÏ߳̿ØÖƵĻù´¡¡£Ïß³Ì״̬×ܵĿɷÖΪÎå´ó״̬£º·Ö±ðÊÇÉú¡¢ËÀ¡¢¿ÉÔËÐС¢ÔËÐС¢µÈ´ý/×èÈû¡£ÓÃÒ»¸öͼÀ´ÃèÊöÈçÏ£º
 
1¡¢ÐÂ״̬£ºÏ̶߳ÔÏóÒѾ­´´½¨£¬»¹Ã»ÓÐÔÚÆäÉϵ÷ÓÃstart()·½·¨¡£
 
2¡¢¿ÉÔËÐÐ״̬£ºµ±Ïß³ÌÓÐ× ......

JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÐÝÃß

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÐÝÃß
 
JavaÏ̵߳÷¶ÈÊÇJava¶àÏ̵߳ĺËÐÄ£¬Ö»ÓÐÁ¼ºÃµÄµ÷¶È£¬²ÅÄܳä·Ö·¢»ÓϵͳµÄÐÔÄÜ£¬Ìá¸ß³ÌÐòµÄÖ´ÐÐЧÂÊ¡£
 
ÕâÀïÒªÃ÷È·µÄÒ»µã£¬²»¹Ü³ÌÐòÔ±Ôõô±àдµ÷¶È£¬Ö»ÄÜ×î´óÏ޶ȵÄÓ°ÏìÏß³ÌÖ´ÐеĴÎÐò£¬¶ø²»ÄÜ×öµ½¾«×¼¿ØÖÆ¡£
 
Ïß³ÌÐÝÃßµÄÄ¿µÄÊÇʹÏß³ÌÈóöCPUµÄ×î¼òµ¥µÄ×ö·¨Ö®Ò»£¬Ïß³ÌÐÝÃß ......

JavaỊ̈߳º²¢·¢Ð­×÷ ËÀËø

JavaỊ̈߳º²¢·¢Ð­×÷-ËÀËø
 
Ï̷߳¢ÉúËÀËø¿ÉÄÜÐÔºÜС£¬¼´Ê¹¿´ËÆ¿ÉÄÜ·¢ÉúËÀËøµÄ´úÂ룬ÔÚÔËÐÐʱ·¢ÉúËÀËøµÄ¿ÉÄÜÐÔÒ²ÊÇС֮ÓÖС¡£
 
·¢ÉúËÀËøµÄÔ­ÒòÒ»°ãÊÇÁ½¸ö¶ÔÏóµÄËøÏ໥µÈ´ýÔì³ÉµÄ¡£
 
ÔÚ¡¶JavaỊ̈߳ºÏ̵߳Äͬ²½ÓëËø¡·Ò»ÎÄÖУ¬¼òÊöËÀËøµÄ¸ÅÄîÓë¼òµ¥Àý×Ó£¬µ«ÊÇËù¸øµÄÀý×ÓÊDz»ÍêÕûµÄ£¬ÕâÀï¸ø³öÒ»¸öÍêÕûµÄÀ ......

Eclipse Java×¢ÊÍÄ£°åÉèÖÃÏê½â


ÉèÖÃ×¢ÊÍÄ£°åµÄÈë¿Ú£º Window->Preference->Java->Code Style->Code Template È»ºóÕ¹¿ªComments½Úµã¾ÍÊÇËùÓÐÐèÉèÖÃ×¢Ê͵ÄÔªËØÀ²¡£ÏÖ¾Íÿһ¸öÔªËØÖðÒ»½éÉÜ£º
Îļþ(Files)×¢ÊͱêÇ©£º
/**   
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(ÓÃÒ»¾ä»°ÃèÊö¸ÃÎļ ......

JavaỊ̈߳ºÐÂÌØÕ÷ ×èÈû¶ÓÁÐ

JavaỊ̈߳ºÐÂÌØÕ÷-×èÈû¶ÓÁÐ
 
×èÈû¶ÓÁÐÊÇJava5Ïß³ÌÐÂÌØÕ÷ÖеÄÄÚÈÝ£¬Java¶¨ÒåÁË×èÈû¶ÓÁеĽӿÚjava.util.concurrent.BlockingQueue£¬×èÈû¶ÓÁеĸÅÄîÊÇ£¬Ò»¸öÖ¸¶¨³¤¶ÈµÄ¶ÓÁУ¬Èç¹û¶ÓÁÐÂúÁË£¬Ìí¼ÓÐÂÔªËصIJÙ×÷»á±»×èÈûµÈ´ý£¬Ö±µ½ÓпÕλΪֹ¡£Í¬Ñù£¬µ±¶ÓÁÐΪ¿Õʱºò£¬ÇëÇó¶ÓÁÐÔªËصIJÙ×÷ͬÑù»á×èÈûµÈ´ý£¬Ö±µ½ÓпÉÓÃÔªËØΪ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ