摘要:
Careful: git reset --hard WILL DELETE YOUR WORKING DIRECTORY CHANGES. Be sure tostash any local changes you want to keep before running this command. 阅读全文
posted @ 2016-05-13 09:56
沧海一滴
阅读(230)
评论(0)
推荐(0)
摘要:
I have always read that creating threads is expensive. I also know that you cannot rerun a thread. I see in the doc of Executors class: Creates a thre 阅读全文
posted @ 2016-05-13 01:56
沧海一滴
阅读(347)
评论(0)
推荐(0)
摘要:
1.Excutor 源码非常简单,只有一个execute(Runnable command)回调接口 public interface Executor { /** * Executes the given command at some time in the future. The comman 阅读全文
posted @ 2016-05-13 01:23
沧海一滴
阅读(4431)
评论(0)
推荐(0)
摘要:
这是一个来自实际项目的例子,在这个案例中,有同事基于jdk中的LinkedHashMap设计了一个LRUCache,为了提高性能,使用了 ReentrantReadWriteLock 读写锁:写锁对应put()方法,而读锁对应get()方法,期望通过读写锁来实现并发get()。 代码实现如下: [j 阅读全文
posted @ 2016-05-13 01:04
沧海一滴
阅读(1281)
评论(0)
推荐(0)
摘要:
Java中的LinkedHashMap此实现与 HashMap 的不同之处在于,后者维护着一个运行于所有条目的双重链接列表。此链接列表定义了迭代顺序,该迭代顺序通常就是将键插入到映射中的顺序(插入顺序)。LinkedHashMap和TreeMap的区别 首先2个都是map,所以用key取值肯定是没区 阅读全文
posted @ 2016-05-13 01:01
沧海一滴
阅读(361)
评论(0)
推荐(0)