摘要: Condition 将 Object 监视器方法(wait、notify 和 notifyAll)分解成截然不同的对象,以便通过将这些对象与任意 Lock 实现组合使用,为每个对象提供多个等待 set (wait set)。其中,Lock 替代了 synchronized 方法和语句的使用,Cond... 阅读全文
posted @ 2015-10-12 10:30 黎明露珠 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.itzhai.com/the introduction and use of semaphore.html 相关介绍 public class Semaphore extends Object implements Serializable 一个计数信号量。从概念上讲,... 阅读全文
posted @ 2015-10-12 10:25 黎明露珠 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.itzhai.com/the introduction and use of cyclicbarrier.html 类说明: 一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point)。在涉及一组固定大小的线程的程序中,... 阅读全文
posted @ 2015-10-12 09:57 黎明露珠 阅读(646) 评论(0) 推荐(0) 编辑