問二十四:分類說明JUC包常用類有哪些?

JUC中常用類彙總

JUC的atomic包下運用了CAS的AtomicBoolean、AtomicInteger、AtomicReference等原子變量類

 

JUC的locks包下的AbstractQueuedSynchronizer(AQS)以及使用AQS的ReentantLock(顯式鎖)、ReentrantReadWriteLock

附:運用了AQS的類還有:Semaphore、CountDownLatch、ReentantLock(顯式鎖)、ReentrantReadWriteLock

 

JUC下的一些同步工具類:CountDownLatch(閉鎖)、Semaphore(信號量)、CyclicBarrier(柵欄)、FutureTask

JUC下的一些併發容器類:ConcurrentHashMap、CopyOnWriteArrayList

JUC下的一些Executor框架的相關類: 線程池的工廠類->Executors  線程池的實現類->ThreadPoolExecutor/ForkJoinPool

JUC下的一些阻塞隊列實現類:ArrayBlockingQueue、LinkedBlockingQueue、PriorityBlockingQueue

附:ForkJoinPool:使用work-stealing的工作方式運行

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章