分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.youkuaiyun.com/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
用ThreadPoolExecutor的时候,又想知道被执行的任务的执行情况,这时就可以用FutureTask。
原创不易,转载请注明出处:spring线程池ThreadPoolExecutor配置并且得到任务执行的结果
代码下载地址:http://www.zuidaima.com/share/1724478138158080.htm
ThreadPoolTask
01 | package com.zuidaima.threadpool; |
03 | import java.io.Serializable; |
04 | import java.util.concurrent.Callable; |
06 | public class ThreadPoolTask implements Callable<String>, Serializable { |
08 | private static final long serialVersionUID = 0 ; |
11 | private Object threadPoolTaskData; |
13 | private static int consumeTaskSleepTime = 2000 ; |
15 | public ThreadPoolTask(Object tasks) { |
16 | this .threadPoolTaskData = tasks; |