2018年12月13日

SynchronousQueue和LinkedBlockingQueue区别

摘要: 在多线程开发中,会用到SynchronousQueue(new CachedThreadPool())和LinkedBlockingQueue(new FixedThreadPoll()) 我们来简单分析一下这两个队列的区别 SynchronousQueue: offer():当线程offer操作时 阅读全文

posted @ 2018-12-13 23:29 持续在更新 阅读(1128) 评论(0) 推荐(0) 编辑

SynchronousQueue中TransferStack原理详解

摘要: SynchronousQueue中非公平模式使用的是TransferStack,它与TransferQueue类似 只是TransferQueue是LILO模式,TransferStack是LIFO模式 same_mode模式,入队 put take fulfill_mode模式,pop出队 put 阅读全文

posted @ 2018-12-13 20:03 持续在更新 阅读(470) 评论(0) 推荐(0) 编辑

SynchronousQueue中TransferQueue原理详解

摘要: SynchronousQueue中分为TransferQueue(公平模式)和TransferStack(非公平模式) 下面我们先分析一下TransferQueue 当新建一个TransferQueue时 如下 通过put或者take调用最终调用transfer()方法 在empty或者same m 阅读全文

posted @ 2018-12-13 18:08 持续在更新 阅读(1025) 评论(0) 推荐(0) 编辑

导航