Java Thread Executor Execute exec(Runnable... commands)

Here you can find the source of exec(Runnable... commands)

Description

exec

License

Open Source License

Declaration

public static void exec(Runnable... commands) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    private static ExecutorService pool = Executors.newCachedThreadPool();

    public static void exec(Runnable... commands) {

        if (commands.length > 0) {
            for (Runnable runnable : commands) {
                pool.execute(runnable);//  w w w  . j  a v a  2s .  co m
            }
        }
    }
}

Related

  1. exec(Callable callable)
  2. execute(Callable callable)
  3. execute(final Runnable task)
  4. execute(int nThreads, List callables)
  5. execute(Runnable command)