Java中和并发相关的类,分别从功能和出现的时间两个角度整理一下这些类。
1. 按功能上划分
Concurrency(from the book of core java)
Synchronization
Thread
- java.lang.Thread
- java.lang.Runnable
Lock Object
- java.util.concurrent.locks.Lock
- java.util.concurrent.locks.ReentrantLock
Condition object
java.util.concurrent.locks.Lock
Lock object 的newCondition()
- java.util.concurrent.locks.Condition
synchronized keyword
Object内部lock, synchronized keyword (apply to method or code block)
java.lang.ObjectLock Testing and Timeouts
- java.util.concurrent.locks.Lock
- java.util.concurrent.locks.Condition
read/writelocksk
java.util.concurrent.locks.ReentrantReadWriteLock
- Monitor concept
- Volatile fields
- Stop, suspendare deprecated
- Blocking Queues
- ArrayBlockingQueue
- LinkedBlockingQueue
- LinkedBlockingDeque
- DelayQueue
- PriorityBlockingQueue
- Thread-safe Collections
- Efficientmaps, sets and queue
- Copyon write arrays
- Olderthread-safe collections
- Callable and Futures
- Executor
- Threadpool
- ScheduledExecution
- Controllinggroup of task
- ForkJoinPool
- Synchronizors
- CyclicBarrier
- CountDownLatch
- Exchanger
- SynchronousQueue
- Semaphore
2 按时间上划分
2.1 Java 1
java.lang.Thread
java.lang.Runnable
java.lang.ThreadGroup
java.lang.Object (notifyAll, notify, wait) } synchronized keyword
java.util.Collections
2.2 Java 5
Lock
java.lang.Thread.UncaughtExceptionHandler
java.util.concurrent.locks.Lock (Interface)
java.util.concurrent.locks.ReentrantLock (class)
java.util.concurrent.locks.Condition (Interface)
java.util.concurrent.locks.ReentrantReadWriteLock (class)
Blocking Queue
java.util.concurrent.ArrayBlockingQueue
java.util.concurrent.LinkedBlockingQueue
java.util.concurrent.DelayQueue
java.util.concurrent.Delayed
java.util.concurrent.PriorityBlockingQueue
java.util.concurrent.BlockingQueue (Interface)
Thread safe collection
java.util.concurrent.ConcurrentLinkedQueue
java.util.concurrent.ConcurrentHashMap
2.3 Java 6
java.util.concurrent.LinkedBlockingDeque
java.util.concurrent.BlockingDeque (Interface)
java.util.concurrent.ConcurrentSkipListSet
java.util.concurrent.ConcurrentSkipListMap
2.4 Java 7
Class java.util.concurrent.ForkJoinPool
RecursiveAction
RecursiveTask