newsinglethreadexector专题

Java线程池(newCachedThreadPool、newFixedThreadPool、newScheduledThreadPool 、newSingleThreadExector )

1、new Thread的弊端 执行一个异步任务你还只是如下new Thread吗? new Thread(new Runnable() {@Overridepublic void run() {// TODO Auto-generated method stub}}).start(); 那你就out太多了,new Thread的弊端如下: a. 每次new Thread新建对象