Java并发编程

来源:互联网 发布:avr单片机教程 郭天祥 编辑:程序博客网 时间:2024/05/18 07:36

Java基本并发

synchronized

Lock及其实现ReentrantLock


JAVA高级并发原语

Semaphores

A semaphore is a counter that controls the access to one or more shared resources. This mechanism is one of the basic tools of concurrent programming and is provided by most of the programming languages.

CountDownLatch

The CountDownLatch class is a mechanism provided by the Java language that allows a thread to wait for the finalization of multiple operations.

CyclicBarrier

The CyclicBarrier class is another mechanism provided by the Java language that allows the synchronization of multiple threads in a common point.

Phaser

The Phaser class is another mechanism provided by the Java language that controls the execution of concurrent tasks divided in phases. All the threads must finish one phase before they can continue with the next one. This is a new feature of the Java 7 API.

Exchanger

The Exchanger class is another mechanism provided by the Java language that provides a point of data interchange between two threads.


Executor and ExecutorService

Runnable

Callable and Future


Fork/Join framework


Concurrent Collections

Non-blocking lists, using the ConcurrentLinkedDeque class
Blocking lists, using the LinkedBlockingDeque class
Blocking lists to be used with producers and consumers of data, using the LinkedTransferQueue class
Blocking lists that order their elements by priority, with the PriorityBlockingQueue
Blocking lists with delayed elements, using the DelayQueue class
Non-blocking navigable maps, using the ConcurrentSkipListMap class
Random numbers, using the ThreadLocalRandom class
Atomic variables, using the AtomicLong and AtomicIntegerArray classes

0 0
原创粉丝点击