ReentrantReadWriteLock&CountDownLatch&CyclicBarrier实现
2020-05-26 09:56:48 0 举报
ReentrantReadWriteLock实现&CountDownLatch实现&CyclicBarrier实现
作者其他创作
大纲/内容
headthread=null
ReentrantReadWriteLock
node[singnal]thread=线程A
FIFO
firstWaiterthread=线程A
tail[exulsive]thread=线程C
CyclicBarrier
node[singnal]thread=线程B
通知加入FIFO
ReentrantReadWriteLock示例,其中读锁是共享锁,当读锁线程拥有锁,通过setHeadAndPropagate会唤醒下个是SHARED状态的节点,b style=\"\
CyclicBarrier cyclicBarrier = new CyclicBarrier(3 );
tail[singnal]thread=线程C
CountDownLatch
node[shared]thread=线程B
node[shared]thread=线程A
tail[singnal]thread=线程B
node[singnal]thread=线程C
lastWaiterthread=线程B
condition
0 条评论
下一页