static{ threadPoolExecutor = new ThreadPoolExecutor(2, 4, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(2), new ThreadFactoryBuilder().setDaemon(true).setNameFormat("ExecuteEngine-%s").build()); }
public static void main(String[] args) throws Exception{
final AtomicLong ai = new AtomicLong(0);
int num = 4; for (int i = 0; i < num; i++) { Worker worker = new Worker(ai); threadPoolExecutor.execute(worker); }