![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
多线程与高并发
IsCassidy
这个作者很懒,什么都没留下…
展开
-
java线程池
• 线程池的好处提高响应速度(减少了创建新线程的时间)降低资源消耗(重复利用线程池中线程,不需要每次都创建)提高线程的可管理性:避免线程无限制创建、从而销耗系统资源,降低系统稳定性,甚至内 存溢出或者CPU耗尽• 线程池的应用场合需要大量线程,并且完成任务的时间端对性能要求苛刻接受突发性的大量请• Executor:线程池顶级接口,只有一个方法• Execut...原创 2019-07-20 22:48:57 · 114 阅读 · 0 评论 -
ThreadLocal
public T get() { Thread t = Thread.currentThread(); ThreadLocalMap map = getMap(t); if (map != null) { ThreadLocalMap.Entry e = map.getEntry(this); ...原创 2019-07-02 23:08:05 · 86 阅读 · 0 评论 -
线程状态
Thread内部enum类 public enum State { /** * Thread state for a thread which has not yet started. */ NEW, /** * Thread state for a runnable thre...原创 2019-06-28 15:56:22 · 95 阅读 · 0 评论 -
compareAndSet与compareAndSwap check and set
compareAndSet是APIcompareAndSwap是底层(sun包或者native c++)实现???原创 2019-07-08 17:34:39 · 1113 阅读 · 0 评论