Hi All,
I am using newFixedThreadPool() from Executors class. when i am fixing the thread size to 2, last two threads are not completing their process,they just stay hanged...I get doubt in my usage of Executors. Could any one please verify the usage....Should any condition to be given before invoking shutdown()....
java.util.concurrent.ExecutorService es=Executors.newFixedThreadPool(2); for(int i=0;i<siteArray.size();i+=2) { String site_ID=siteArray.get(i).toString(); String url=siteArray.get(i+1).toString();//just an array of sites es.execute(new WebCrawlerBatch(url,Integer.parseInt(site_ID)));//process of each thread } es.shutdown(); siteArray=null;