[Solved] Running Multiple Thread Pools (ExecutorService) together

[ad_1]

If you need sequential activity, you can call one task and then another. The simple solution in your case is something like this.

ExecutorService exec = Executors.newFixedThreadPool(2);

exec.execute(new Runnable() {
    public void run() {
        userProvisioner1.run();
        userProvisioner2.run();
    }
});
exec.execute(new Runnable() {
    public void run() {
        userProvisioner3.run();
        userProvisioner4.run();
    }
});

exec.shutdown();
exec.awaitTermination();

[ad_2]

solved Running Multiple Thread Pools (ExecutorService) together