ScheduledExecutorService和ScheduledThreadPoolExecutor的问题
ScheduledExecutorService schedule = Executors.newScheduledThreadPool(int corePoolSize);
请问,schedule创建完毕后,线程池的数量可以改变吗?
我现在想改变,想让线程数目随着ScheduledExecutorService里面添加Runnable任务的多少的变化而变化。
请问怎么弄?
如果直接用ScheduledThreadPoolExecutor schedulePool = new ScheduledThreadPoolExecutor(int corePoolSize,ThreadFactory factory);
那么,schedulePool里面线程的数量可以改变吗?
请问想改变的话怎么改变?
------解决方案--------------------
http://dongxuan.iteye.com/blog/901689
http://dongxuan.iteye.com/blog/902571
------解决方案--------------------
setCorePoolSize()
另外有两篇文章不错:
http://dongxuan.iteye.com/blog/901689
http://dongxuan.iteye.com/blog/902571