1、Java.util.concurrent.atomic包下的原子类 AtomicXXXX(Atomic意为原子的)
例如:AtomicInteger AtomicBoolean AtomicLong
AtomicIntegerArray、AtomicLongArray:该类是Java对Integer数组和Long数组支持的原子性操作;
3、常见的集合类:
List:Vector
Map:ConcurrentHashMap HashTable ConcurrentSkipListMap
Set:ConcurrentSkipListSet
ConcurrentSkipListSet和TreeSet,它们虽然都是有序的集合。但是,第一,它们的线程安全机制不同,TreeSet是非线程安全的,而ConcurrentSkipListSet是线程安全的。第二,ConcurrentSkipListSet是通过ConcurrentSkipListMap实现的,而TreeSet是通过TreeMap实现的。
3、可变字符串:StringBuffer也是线程安全
2、BlockingQueue
和BlockingDeque
BlockingDeque
接口继承了BlockingQueue
接口, BlockingQueue
接口的实现类有ArrayBlockingQueue
,LinkedBlockingQueue
,PriorityBlockingQueue
而BlockingDeque
接口的实现类有LinkedBlockingDeque
BlockingQueue
和BlockingDeque
都是通过使用定义为final的ReentrantLock
作为类属性显式加锁实现同步的