信号量Semaphore,读写锁ReadWriteLock,计数器CountDownLatch,循环栅栏CyclicBarrier运用
1.信号量Semaphore:像synchronized,ReentrantLock等这些对临界区资源进行同步后,所有对临界区资源进行访问的线程都得串行排队,而信号量允许指定的线程数同时进行访问demo:importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;importjava.util.co