[Concurrent programming - foundation] (Introduction) concurrent programming and high concurrency

近期快速的刷了一遍慕课网jimin老师的《Java并发编程与高并发解决方案》课程,本类文章目的为便于后期查阅及巩固学到的内容,更深入的了解并发编程所涉及的内容。

由于[博主Jeff丶Osmond](https://me.csdn.net/jesonjoke) 也是将jimin老师的《Java并发编程与高并发解决方案》课程进行总结,所以本类型的博文也会参考[Jeff丶Osmond](https://me.csdn.net/jesonjoke) 师兄的总结,再此感谢! 

这篇文章用于总结并发编程所涉及内容并重点介绍一下J.U.C。最后会附上之后文章的目录。

First, concurrent programming content:

1, UCS (java.util.concurrent 包)

     1.1, tools frame synchronizer

          ①Executors : create a thread pool ② CyclicBarrier : checkpoint mode ③ Exchanger : interactive data between threads ④ Semaphor : semaphore ⑤CountDownLatch : Counter

     1.2, locks the lock frame

          Can be regarded as synchronized enhanced version provides a limit lock wait, lock interrupt, try to lock functions

     1.3, aotmic atoms class frame

          Providing Object atomic operation

     1.4, collections set frame

          Container type can provide concurrent support

     1.5, executor performs frame

          It includes creating a thread pool thread to obtain the return value and other operations

Here Insert Picture Description

2, other auxiliary concurrent class

     FutureTask 、Fork/Join框架、BlockingQueue

3, the thread pool

     Working state of the thread pool, thread pool, get a thread pool thread pool configuration

4, analog concurrent requests

     Simulation tools, simulation code

5, concurrency issues often encountered with the usual summary

     Deadlock, concurrent best practices, Spring and thread-safe, HashMap concurrent

Second, high concurrency content

1, expansion

2 cache

Third, after the article directory

First, concurrent programming foundation:

​      1.1、并发与并行
​      1.2、CPU多级缓存
​      1.3、CPU缓存一致性(MESI)
​      1.4、Java内存模型
​      1.4、并发的优势与风险
二、并发模拟
​      2.1、并发模拟工具

​      2.2、并发模拟代码

​           2.2.1、CountDownLatch

​           2.2.2、Semaphore

三、线程安全性

​      3.1、线程安全性指标

​           3.1.1、原子性

​           3.1.2、可见性

​           3.1.3、有序性

​      3.2、原子性总结

​           3.2.1、Atomic包…

​           3.2.2、锁

​                3.2.2.1、synchronized

​                3.2.2.2、Lock

​      3.3、可见性总结

​      3.4、有序性总结

​      3.5、线程安全指标总结

四、安全发布对象

​      4.1、发布对象

​      4.2、对象溢出

​      4.3、安全的发布对象

​      4.4、看似安全的单例模式(懒汉模式下的volatile+if双重检测机制,禁止指令重排)

​      4.4、枚举模式实现单例模式

五、线程安全策略

​      5.1、不可变对象final

​      5.2、线程封闭

​      5.3、线程不安全类与安全类

​      5.4、同步容器

​      5.5、安全共享对象策略

六、J.U.C的AQS(队列同步器 AQS:AbstractQueuedSynchronizer)

​      6.1、AQS是什么

​      6.2、CountDownLatch

​      6.3、Semaphore(牛逼)

​      6.4、CyclicBarrier

​      6.5、ReentrantLock与锁(牛逼)

七、J.U.C组件扩展

​      7.1、FutureTask 获取线程返回值

​           7.1.1、Callable与Runnable接口对比

​           7.1.2、Future接口

​           7.1.3、FutureTask类

​           7.1.4、实战FutureTask和Future

​      7.2、Fork/Join框架

​      7.3、BlockingQueue 阻塞队列

​           7.3.1、阻塞队列

​           7.3.2、阻塞队列的四个方法

​           7.3.3、BlockingQueue的实现类

​                7.3.3.1、ArrayBlockingQueue

​                7.3.3.2、DelayQueue

​                7.3.3.3、LinkedBlockingQueue

​                7.3.3.4、PriorityBlockingQueue

​                7.3.3.5、 SynchronousQueue

八、线程池

​      8.1、new Thread的弊端

​      8.2、线程池的好处

​      8.3、线程池-ThreadPoolExecutor

​           8.3.1、线程池的三个参数

​                corePoolSize

​                maximumPoolSize

​                workQueue

​           8.3.2、提交新任务时线程池的三种处理方式

​                8.3.2.1、直接切换

​                8.3.2.2、使用无界队列

​                8.3.2.3、使用有界队列

​                8.3.2.4、四种拒绝处理的策略

​      8.4、线程实例的状态

​           8.4.1、RUNNING

​           8.4.2、SHUTDOWN

​           8.4.3、STOP

​           8.4.4、TIDYING

​           8.4.5、TERMINATED

​           8.5、ThreadPoolExecutor提供的方法

​           8.6、Executor框架接口与常用方法

​           8.7、合理配置线程池

九、多线程并发扩展

​      9.1、死锁

​      9.2、并发最佳实践

​      9.3、Spring与线程安全

​      9.4、HashMap

​      9.5、多线程并发与线程安全总结

以下是高并发的内容

十、高并发处理思路与手段

​      10.1、扩容

​      10.2、缓存

​      10.3、缓存分类和应用场景

​           10.3.1、本地缓存

​           10.3.2、分布式缓存

​                10.3.2.1、Memcache缓存

​                10.3.2.1、Redis缓存

​      10.5、高并发场景下缓存的常见问题

​           10.5.1、缓存一致性

​           10.5.2、缓存并发问题

​           10.5.3、缓存穿透问题

​           10.5.4、缓存雪崩现象

​      10.6、缓存高并发实战、股票分时线

​           百度搜索:redis在股票分时K线图计算的实践

After thinking this will be used in commercial projects I take on school and learning in order to achieve code shows the consolidation.

10.7, using Redis

Published 20 original articles · won praise 1 · views 567

Guess you like

Origin blog.csdn.net/weixin_42295814/article/details/103762641