2019年4月9日

用readWriteLock实现一个缓存

摘要: double check查询缓存 阅读全文

posted @ 2019-04-09 18:41 张小泽的小号 阅读(147) 评论(0) 推荐(0) 编辑

信号量实现对象池

摘要: class ObjPool{ final List pool; //信号量实现限流器 final Semaphore sem; //构造方法 ObjectPool(int size,T t){ pool = new Vector(){}; for(int i=0; i func){ T t = null; sem.acquire(); try{ ... 阅读全文

posted @ 2019-04-09 15:03 张小泽的小号 阅读(159) 评论(0) 推荐(0) 编辑

导航