2015年11月26日 星期四

threadpool

public int abc()
    {
        ExecutorService executor = Executors.newFixedThreadPool(1);
        readCmdGpio rCmdGpio = new readCmdGpio();
        Future future = executor.submit(rCmdGpio);

    }

    private class readCmdGpio implements Callable
    {
        @Override
        public Integer call() throws Exception {

            return 0;
        }
    }
http://stackoverflow.com/questions/3141158/how-can-a-thread-return-a-value-after-finishing-its-job

http://www.journaldev.com/1069/java-thread-pool-example-using-executors-and-threadpoolexecutor

沒有留言:

張貼留言