jdk util concurrent 源码阅读(一)
对于object隐式锁和lock(condition)两种方式,下面问题:
- entry set 抢锁机制
- wait set 唤醒机制(随机?)
- wait set 唤醒之后没有抢到锁直接放入entry set?还是继续留存wait set?
- reentrantlock lock readwritelock 经典场景
To a great extent, the manner in which a Java Virtual Machine implementation selects the next thread from the wait or entry sets is a decision of individual implementation designers. For example, implementation designers can decide how to select:
- thread from the wait set given a notify command
- the order to resurrect threads from the wait set given a notify all command
- the order to allow threads from the entry set to acquire the monitor
- how to choose between threads suspended in the wait set versus the entry set after a notify command
阅读资料:
- inside jvm
- java concurrecy in practice
- java 多线程 待补
http://robbinfan.com/blog/38/orm-cache-sumup