/** * 使用BlockingQueue实现主子线程互相打印 * @author duwenlei * */ public class BlockingQueueTest { public static void main(String[] args) { final Business business = new Business(); new Thread(new Runnable() { @Override public void run() { while(true){ busines…
package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * Created by windwant on 2016/5/26. */ public class MyBlockingQueue { public static void main(String[] args) throws InterruptedException { testArrayBlockingQu…
我们到底能走多远系列(42) 扯淡: 乘着有空,读些juc的源码学习下.后续把juc大致走一边,反正以后肯定要再来. 主题: BlockingQueue 是什么 A java.util.Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in…