该文被密码保护。 阅读全文
posted @ 2017-12-20 22:21 林** 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1.newSingleThreadExecutor单任务线程池, 一次只执行一个任务 阅读全文
posted @ 2017-12-19 15:37 林** 阅读(784) 评论(0) 推荐(0) 编辑
摘要: 1. newCachedThreadPool无上限线程池, 动态根据代码添加线程, 如果线程空闲60秒没有被使用,会自动关闭 阅读全文
posted @ 2017-12-19 15:33 林** 阅读(3144) 评论(0) 推荐(0) 编辑
摘要: 1.newFixedThreadPool固定线程池, 使用完毕必须手动关闭线程池, 否则会一直在内存中存在, 阅读全文
posted @ 2017-12-19 15:27 林** 阅读(5742) 评论(0) 推荐(0) 编辑
摘要: 1 package unit; 2 3 import java.util.concurrent.Executors; 4 import java.util.concurrent.ScheduledExecutorService; 5 import java.util.concurrent.ScheduledFuture; 6 import java.util.concurrent.... 阅读全文
posted @ 2017-12-15 18:15 林** 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 1 package unit; 2 3 import java.io.ByteArrayOutputStream; 4 import java.io.File; 5 import java.io.FileOutputStream; 6 import java.io.IOException; 7 import java.io.InputStream; ... 阅读全文
posted @ 2017-12-13 17:53 林** 阅读(1101) 评论(0) 推荐(0) 编辑
摘要: 1 package unit; 2 3 import java.util.concurrent.ArrayBlockingQueue; 4 import java.util.concurrent.ThreadPoolExecutor; 5 import java.util.concurrent.TimeUnit; 6 7 public class ThreadPoolExecu... 阅读全文
posted @ 2017-12-13 17:51 林** 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 package unit; 2 3 import java.util.concurrent.ArrayBlockingQueue; 4 5 /** 6 * 阻塞队列 7 * @author 54304 8 * 9 */ 10 public class BlockingQueue { 11 private int queueSize = 10; 12 ... 阅读全文
posted @ 2017-12-13 17:50 林** 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 package unit; 2 3 import java.util.PriorityQueue; 4 5 /** 6 * 非阻塞队列 7 * @author 54304 8 * 9 */ 10 public class BlockingQueue { 11 private int queueSize = 10; 12 private Prior... 阅读全文
posted @ 2017-12-13 17:48 林** 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 3. 读取文件内容 4. 写入文件 5. 创建文件 6. 如果不存在就创建新文件, 如果存在就覆盖 7. 追加字符串到指定文件中 8. 读取文件信息 阅读全文
posted @ 2017-12-13 17:37 林** 阅读(480) 评论(0) 推荐(0) 编辑