javaÖйØÓÚÓÅÏȼ¶¶ÓÁеÄʵÏÖ
Õ⼸ÌìÒ»Ö±ÔÚ¸ã¹ØÓÚÓÅÏȼ¶¶ÓÁеÄʵÏÖ,ÒòΪҪ¿¼Âǵ½Ï̵߳ݲȫ,ËùÒÔPriorityQueue¾Í²»ÊÊÓÃÁË¡£Ò»¸ö·Ç³£¼òµ¥µÄʵÏÖ·½
·¨£¬ÄǾÍÊÇ°ÑÓÅÏȼ¶±È½ÏºÃµÄ²åÈëÒ»¸ö¶ÓÁУ¬ÓÅÏȼ¶µÍµÄ²åÈëÁíÒ»¸ö¶ÓÁУ¬È¡ÊýµÄʱºòÏÈÔÚÓÅÏȼ¶¸ßµÄ¶ÓÁÐÉÏÈ¡Êý¡£ÕâÓиöȱµã¾ÍÊÇÈç¹ûÓÅÏȼ¶±ðÔ½¶àµÄ»°£¬¶ÓÁоÍ
Ô½¶à¡£
ÒòΪҪḬ̈߳²È«£¬¶ÓÁвÉÓÃ
ConcurrentLinkedQueue
Õâ¸öḬ̈߳²È«µÄ£¬¶øapiÎĵµÉÏ˵ConcurrentLinkedQueue
²ÉÓÃÁËÓÐЧµÄ“Î޵ȴý (wait-free)”Ëã·¨£¬ËùÒÔËüµÄÍÌÍÂÁ¿ÊǺܲ»´íµÄ£¡
¼òµ¥´úÂëÈçÏ£º
package
test;
import
java.util.concurrent.ConcurrentLinkedQueue
;
public
class
PriorityQueueTest {
public
static
void
main(String[] args) {
ConcurrentLinkedQueue
<String> highPriority =
new
ConcurrentLinkedQueue
<String>();
//¸ßÓÅÏȼ¶
ConcurrentLinkedQueue
<String> lowPriority =
new
ConcurrentLinkedQueue
<String>();
//µÍÓÅÏȼ¶
highPriority.add(
"aaa"
);
highPriority.add(
"bbb"
);
highPriority.add(
"111"
);
lowPriority.add(
"ccc"
);
lowPriority.add(
"ddd"
);
lowPriority.add(
"222"
);
int
i =
0
,j =
0
, 
Ïà¹ØÎĵµ£º
10.2.4.3 Àý×Ó3£ºÍøÂçÓ¦ÓòãÐÒéµÄ¿ª·¢
Ç廪´óѧ³ö°æÉ硶Java³ÌÐòÔ±£¬ÉÏ°àÄǵãʶù¡·×÷ÕߣºÖÓÉù——µÚ10Õ¡¶¸ßÊÖÓжà¸ß²ËÄñÓжà²Ë¡·²¿·Ö½ÚÑ¡¡£
´ó¼ÒÒ²Ðí¶¼ÓùýFTPÉÏ´«ÏÂÔع¤¾ß£¬±ÈÈç“LeapFTP”Õâ¸ö¹¤¾ßÊÇÒ ......
»ù±¾Ä£Ê½£º
1. ½Ó¿Úģʽ£ºµ±¶à¸öÀàÌṩ½üËƵķþÎñµÄʱºò£¬Í¨¹ý½Ó¿Úģʽ£¬²»Í¬µÄ·þÎñÌṩÕßÀàËùÌṩµÄ¹²Í¬µÄ·þÎñ¾Í¿ÉÒÔ±»³éÏó³öÀ´£¬²¢±»ÉùÃ÷Ϊһ¸ö¶ÀÁ¢µÄ½Ó¿Ú¡£ÕâÑù¿Í»§¶ÔÏó¾ÍÄÜÒÔÒ»ÖÖÎÞ·ìµÄ·½Ê½À´Ê¹Óò»Í¬µÄ·þÎñÌṩÀ࣬¶øÎÞÐè½øÐÐÈκθĶ¯¡£
2. ³éÏóÀàģʽ£º¿ÉÒÔ ......
¡¡ ¡¡¡¡
¡¡¡¡Èí¼þ¿ª·¢Ö®Â·ÊdzäÂú¾£¼¬ÓëÌôս֮·,Ò²ÊdzäÂúÏ£Íû֮·¡£JAVAѧϰҲÊÇÈç´Ë£¬Ã»Óнݾ¶¿É×ß¡£ÃÎÏëÏñ¡¶ÌìÁú°Ë²¿¡·ÖÐÐéÖñÒ»Ñù±»ÎÞÑÂ×Óõ®õ¹à¶¥¶øÇáËÉ»ñµÃÒ»¼××Ó¹¦Á¦£¬ÊǺܲ»ÏÖʵµÄ¡£Ã¿ÌìÑöÌì´ó½Ð"ÌìÉñ°¡£¬Çë´Í¸øÎÒÒ»±¾¿û»¨±¦µä°É"£¬Êâ²»Öª¼´Ê¹Äã»ñµÃÁË¿û»¨±¦µä£¬³ýÁËÊÜ×Ô¹¬ÆäÉíÖ®¿àÍ⣬ÄãÒ²²»Ò»¶¨³ÉµÃÁË"¶«·½² ......
¾³£¿´µ½Ðí¶àÈËÎÊÈçºÎÅäÖÃJDKºÍJSP£¬ÏÖÔÚÎÒ°Ñ·½·¨×ܽáÏ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØjdkºÍtomcat
µÚ¶þ²½£º°²×°ºÍÅäÖÃÄãµÄjdkºÍtomcat£ºÖ´ÐÐjdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºóÉèÖð´ÕÕ·¾¶½øÐа²×°¼´¿É¡£
1.°²×°j2sdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿ÖÐÌí¼Ó ......