摘要: 还有一种方式,在t3开始前join t2,在t2开始前join t1 阅读全文
posted @ 2016-03-01 16:58 艺言弈行 阅读(8791) 评论(0) 推荐(2) 编辑
摘要: 使用阻塞队列代码要简单得多,不需要再单独考虑同步和线程间通信的问题 在并发编程中,一般推荐使用阻塞队列 public class BolckQuene_Pro_Con { private int queueSize = 10;//队列允许存放的最大数 private ArrayBlockingQue 阅读全文
posted @ 2016-03-01 16:56 艺言弈行 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 非阻塞队列,需要考虑到: 1.并发中的同步 2.线程间通信 public class Quene_Pro_Con { //定义队列大小 private static int size = 10; //非阻塞队列 private static PriorityQueue<Integer> quene 阅读全文
posted @ 2016-03-01 16:55 艺言弈行 阅读(680) 评论(0) 推荐(0) 编辑