
java
weixin_42072543
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Java源码阅读之String.hashCode
JAVA中hashCode源码分析 public static int hashCode(byte[] value) { int h = 0; int length = value.length >> 1; for (int i = 0; i < length; i++) { h = 31 * h +...原创 2019-03-29 16:13:25 · 189 阅读 · 1 评论 -
java源码阅读之序列化Serializable
总结 Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. 没有实现Serializable接口的类...原创 2019-03-30 20:40:54 · 163 阅读 · 0 评论 -
java源码阅读之深入理解ThreadLocal
protected T initialValue() { return null; } 必须重写此方法,否则初始化值为null void createMap(Thread t, T firstValue) { t.threadLocals = new ThreadLocalMap(this, firstValue); } 为本地线程创建LocalMap,使用firstValu...原创 2019-03-31 17:34:27 · 234 阅读 · 0 评论 -
java源码阅读之深入理解AQS
先翻译源码介绍 Provides a framework for implementing blocking locks and related synchronizers (semaphores, events, etc) that rely on first-in-first-out (FIFO) wait queues. This class is designed to be a use...原创 2019-04-01 17:13:47 · 218 阅读 · 0 评论 -
java线程池简单介绍以及适用场景
四种线程池的介绍 newFixedThreadPool(int nThads) 定长的线程池 阻塞队列长度无限并且其中的线程可复用 当核心线程池满了的时候新的线程会在阻塞队列上等待 线程池中的线程需要shutdown才会释放,否则一直存在 适用场景: 适用场景:适合执行周期长的任务 newSingleThreadExecutor() 每次只有一个活动线程运行 阻塞队列无限 和newF...原创 2019-04-07 09:34:13 · 296 阅读 · 0 评论