Skip to content

ExecutorExample

test

void test() {
    ExecutorService ex = Executors.newFixedThreadPool(10);
    for (int i = 0; i < 10; i++) {
        ex.submit(() -> {
            System.out.println("submitting work on: " + Thread.currentThread().getName());
        });
    }
    ex.shutdown();
}