Java????Executor???
???????????? ???????[ 2016/4/25 11:18:54 ] ??????????????????? ???????
????2.2.1.1 ???????????
????1???????ж????????????????????????????????????μ???????????????????????????????????
????2???????ж??????????????????????????????????洢?????????????????????????
????3???????ж???????????????????????У??????μ??????????????????????????????????
????ThreadPoolExecutor???execute()?????????
????1???????????е????????corePoolSize?????????????????????ò??????????????
????2????????е???????????corePoolSize???????????BlockingQueue;
????3???????????????????????????У??????μ???????????????ò????????????
????4???????????????????????е???????maximumPoolSize???????????????????RejectedExecutionHandle.rejectedExecution??????????
????2.2.2 ThreadPoolExecutor
????FixedThreadPool????????ù??????????????????????????????????????????????????ó????????????????????????
????public static ExecutorService newFixedThreadPool(int nThreads) {
????return new ThreadPoolExecutor(nThreads??nThreads??0L??TimeUnit.MILLISECONDS??new LinkedBlockingQueue<Runnable>());
????}
????SingleThreadPool?????????????????????????????и??????????????????????????ж????????????????????????????????
????public static ExecutorService newSingleThreadExecutor(){
????return new ThreadPoolExecutor(1??1??0L??TimeUnit.MILLISECONDS??new LinkedBlockingQueue<Runnable>());
????}
????CachedThreadPool???????????????????????????????????????????????????????п?????????????????п???????????????
????public static ExecutorService newCachedThreadPool(){
????return new ThreadPoolExecutor(0??Integer.Max_VALUE??60L??TimeUnit.SECONDS??new SysnchronousQueue<Runnable>());
????}????60??????????????
????2.2.3 ScheduledThreadPoolExecutor
????ScheduledThreadPoolExecutor???ThreadPoolExecutor?????????????????????????????????????????Timer???Timer??????????????ScheduledThreadPoolExecutor?????????????????????????????????
????ScheduledExecutorService????????2?????????????????????????
????scheduleAtFixedRate(Runnable command??long initialDelay??long period??TimeUnit unit)
??????????????÷????????????????????????????????????????????????????е???????????????period?1s??????????5s??????????????????????????????????С?
????????????????
????for (int i = 0; i < 3; i++) {
????Thread.sleep(1000);
????WorkerThread worker = new WorkerThread("do heavy processing");
????// schedule task to execute at fixed rate
????scheduledThreadPool.scheduleAtFixedRate(worker?? 0?? 10??
????TimeUnit.SECONDS);
???????
Current Time = Tue Oct 29 16:10:00 IST 2013
pool-1-thread-1 Start. Time = Tue Oct 29 16:10:01 IST 2013
pool-1-thread-2 Start. Time = Tue Oct 29 16:10:02 IST 2013
pool-1-thread-3 Start. Time = Tue Oct 29 16:10:03 IST 2013
pool-1-thread-1 End. Time = Tue Oct 29 16:10:06 IST 2013
pool-1-thread-2 End. Time = Tue Oct 29 16:10:07 IST 2013
pool-1-thread-3 End. Time = Tue Oct 29 16:10:08 IST 2013
pool-1-thread-1 Start. Time = Tue Oct 29 16:10:11 IST 2013
pool-1-thread-4 Start. Time = Tue Oct 29 16:10:12 IST 2013
????scheduleWithFixedDelay(Runnable command??long initialDelay??long delay??TimeUnit unit)
?????÷??????????????????????????delaytime?????????е?????ο?????????????????????????????
????for (int i = 0; i < 3; i++) {
????Thread.sleep(1000);
????WorkerThread worker = new WorkerThread("do heavy processing");
????scheduledThreadPool.scheduleWithFixedDelay(worker?? 0?? 1??
????TimeUnit.SECONDS);
????}
??????????
Current Time = Tue Oct 29 16:14:13 IST 2013
pool-1-thread-1 Start. Time = Tue Oct 29 16:14:14 IST 2013
pool-1-thread-2 Start. Time = Tue Oct 29 16:14:15 IST 2013
pool-1-thread-3 Start. Time = Tue Oct 29 16:14:16 IST 2013
pool-1-thread-1 End. Time = Tue Oct 29 16:14:19 IST 2013
pool-1-thread-2 End. Time = Tue Oct 29 16:14:20 IST 2013
pool-1-thread-1 Start. Time = Tue Oct 29 16:14:20 IST 2013
pool-1-thread-3 End. Time = Tue Oct 29 16:14:21 IST 2013
pool-1-thread-4 Start. Time = Tue Oct 29 16:14:21 IST 2013
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????