Java并發(fā)與多線程學習
向Doug Lea致敬
<img ur='http://ifeve.com/wp-content/uploads/2013/05/2934349b033b5bb502db9e8436d3d539b600bcb8.jpg'/>
<pre>
給自己挖個大坑
向把java并發(fā)領域自己接觸過的知識做個大綱,目標是2017年上半年完成大綱里文章
</pre>
Java多線程使用
多線程同步技術
sychronzied關鍵字
sychronzied 三個使用范圍和對應監(jiān)視器對象
使用鎖來同步
可重入鎖ReentrantLock
鎖的各種概念
鎖粒度與并發(fā)級別
死鎖
活鎖
饑餓
ReadWriteLock和ReentrantLock使用
可重入鎖與讀寫鎖所用
三種同步技術比較
性能 便捷性等
volatile關鍵字
計算機體系結構和java內(nèi)存模型
volatile關鍵字的語義(可見性)
使用volatile經(jīng)典使用場景
使用Object對象的wait()和notify方法實現(xiàn)線程通信
使用wait和notify實現(xiàn)生產(chǎn)者和消費者
JUC線程池和任務執(zhí)行框架
Executor框架
- ThreadPoolExecutor
- ScheduledThreadPoolExecutor
- ExecutorService
Fork Join 任務并行執(zhí)行框架
Doug Lea 原始Fork Join框架論文
Fork Join框架的思想: 遞歸 分治 工作竊取
Callable和Future返回異步執(zhí)行結果
異步執(zhí)行也可以獲取執(zhí)行結果
原子操作工具類
原子操作工具類使用
- AtomicInteger
- AtomicLong
- AtomicLongArray
- AtomicReference 等等 不一一列舉
原子操作工具類的原理
CAS原理
并發(fā)容器
- ConcurrenthashMap
- ConcurrentLinkedDeque
- ConcurrentLinkedQueue
- ConcurrentSkipListMap
阻塞容器
- AbstractQueuedSynchronizer 基于FIFO對列的阻塞鎖和同步工具類框架
- ArrayBlockingQueue DelayQueue 等一堆BlockingQueue 實現(xiàn)類
高級同步工具
- CountDownLatch
- CyclicBarrier
- Semaphore
- Condition
Lock free 實現(xiàn)和使用
CAS指令
并發(fā)設計模式
脫離java語言和JVM平臺 從更廣泛的計算機領域視角看并發(fā)與并行編程,并發(fā)編程一些通用模式的總結
抄自維基百科
- Read write lock pattern
- Thread pool pattern
- Thread-local storage
- Barrier
- Scheduler pattern
- Double-checked locking
- Immutability
- 不一一列舉
并發(fā)設計模式參考資料
- [Patterns for Concurrent, Parallel, and Distributed Systems] (http://www.cs.wustl.edu/~schmidt/patterns-ace.html)
- [Concurrency talk given at Scaleconf] (http://shairosenfeld.com/concurrency.html)