线程池可以在应用创建时就创建多个线程,在需要的时候直接取用,而不必自己创建,从而提高效率。
如下创建:
ExecutorService pool = Executors.newFixedThreadPool(100);
pool.submit(new thread);