摘要:
参考: https://www.cnblogs.com/lemon-flm/p/7877898.html 阅读全文
摘要:
避免使用 Executors 来创建线程。 说明: Executors各个方法的弊端: 1)newFixedThreadPool和newSingleThreadExecutor: 主要问题是堆积的请求处理队列可能会耗费非常大的内存,甚至OOM。 2)newCachedThreadPool和newSc 阅读全文
摘要:
首先简单介绍下RateLimiter的使用, public void testAcquire() { RateLimiter limiter = RateLimiter.create(1); for(int i = 1; i < 10; i = i + 2 ) { double waitTime = 阅读全文
摘要:
参考: http://www.cnblogs.com/frinder6/p/5507082.html https://blog.csdn.net/m0_37822338/article/details/100010495 注意: Callable接口支持返回执行结果,此时需要调用FutureTask 阅读全文
摘要:
参考:http://www.360doc.com/content/20/0316/09/33260087_899509976.shtml 阅读全文