1、Java.util.concurrent.atomic包下的原子类 AtomicXXXX(Atomic意为原子的)
例如:AtomicInteger AtomicBoolean AtomicLong
AtomicIntegerArray、AtomicLongArray:该类是Java对Integer数组和Long数组支持的原子性操作;
2、常见的集合类
List:Vector (效率低,不建议用)
Map:ConcurrentHashMap HashTable ConcurrentSkipListMap
Set:ConcurrentSkipListSet
ConcurrentSkipListSet和TreeSet,它们虽然都是有序的集合。但是,第一,它们的线程安全机制不同,TreeSet是非线程安全的,而ConcurrentSkipListSet是线程安全的。第二,ConcurrentSkipListSet是通过ConcurrentSkipListMap实现的,而TreeSet是通过TreeMap实现的。
3、可变字符串:StringBuffer也是线程安全
4、BlockingQueue 和 BlockingDequeBlockingDeque
接口继承了BlockingQueue
接口, BlockingQueue
接口的实现类有ArrayBlockingQueue
,LinkedBlockingQueue
,PriorityBlockingQueue
而BlockingDeque
接口的实现类有LinkedBlockingDeque
BlockingQueue
和BlockingDeque
都是通过使用定义为final的ReentrantLock
作为类属性显式加锁实现同步的
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。