併發容器和同步容器

list
   arraylist 數組
   linkedList 雙向鏈表(堆棧和隊列都可以使用)
   ArrayDeque 循環數組(堆棧和隊列都可以使用,優先於linkedList)
   vectory  同步容器,數組
   Stack  extends vectory 堆棧
   Collections.synchronizedList(arraylist)同步容器
   Collections.synchronizedList(linkedList)同步容器
   Collections.synchronizedList(ArrayDeque)同步容器
   CopyOnWriteArrayList 併發容器 讀寫分離
   ConcurrentLinkedQueue 併發容器 非阻塞隊列
   LinkedBlockingQueue   併發容器  阻塞隊列 隊列
   ArrayBlockingQueue    併發容器  阻塞隊列 數組
   linkedblockingdeque   併發容器  阻塞雙端隊列 鏈表 
    PriorityBlockingQueue併發容器 阻塞隊列 鏈表 可以排序

   set
   hashset 哈希表結構(數組和單向鏈表)
   linkedhashset 哈希表結構外加雙向鏈表(數組和單向鏈表雙向鏈表(雙向鏈表保持插入的順序))
   treeset 紅黑樹結構 可以排序
   Collections.synchronizedSet(hashset)同步容器
   Collections.synchronizedSet(linkedhashset)同步容器
   Collections.synchronizedSortedSet(treeset)同步容器
   CopyOnWriteArraySet 併發容器 讀寫分離 底層使用CopyOnWriteArrayList 




   map
   hashmap哈希表結構(數組和單向鏈表)
   treemap紅黑樹結構 可以排序
   linkedhashmap哈希表結構外加雙向鏈表(數組和單向鏈表和雙向鏈表(雙向鏈表保持插入的順序))
   hashtable哈希表結構(數組和單向鏈表)同步容器
   WeakHashMap的鍵對象爲弱引用
   Collections.synchronizedMap(hashmap)同步容器
   Collections.synchronizedMap(linkhashmap)同步容器
   Collections.synchronizedMap(WeakHashMap)同步容器
   Collections.synchronizedSortedMap(treemap)同步容器
   concurrenthashmap併發容器
    
   
   
   SynchronousQueue無數據結構
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章