Java tutorial
//package com.java2s; import java.util.concurrent.Executor; import java.util.concurrent.Executors; public class Main { private static Executor s_executor = Executors.newCachedThreadPool(); private static synchronized Executor getExecutor() { if (s_executor == null) s_executor = Executors.newCachedThreadPool(); return s_executor; } }