import org.israfil.concurrent.ThreadPool; public class ConcurrencyExample { public static void main(String[] args) { ThreadPool threadPool = new ThreadPool(); for (int i = 0; i < 10; i++) { final int taskNumber = i; threadPool.execute(() -> { System.out.println("Task " + taskNumber + " is running."); }); } threadPool.shutdown(); } }


上一篇:
下一篇:
切换中文