Inefficient shutdown() from Executors , preventing the completion of process
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()....
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
Re: Inefficient shutdown() from Executors , preventing the completion of process
Please define 'not completing their process'. How large is siteArray? Do the first few Runnables added to the execute function exit properly? (Calling shutdown doesn't stop the threads, as the API states: " Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.")