Java Concurrency - java.util.concurrent API Class Diagram

摘自: www.uml-diagrams.org

Here we provide several UML class diagrams for the Java™ 7 java.util.concurrent package. Several java.util.concurrent.* packages introduced with version 5.0 of the Java platform added high-level concurrency features to the Java and new concurrent data structures to the Java Collections Framework.

UML class diagram for the Java™ 7 executors and thread pool managers from the java.util.concurrent package.

Executors define a high-level API for launching and managing threads to support large-scale applications mostly by adding thread pool management abilities. The java.util.concurrent package includes several thread pool management implementation classes.

UML class diagram for concurrent collections from the Java 7 java.util.concurrent package.

Concurrent collections are also part of the java.util.concurrent package. These collections reduce the need for synchronization and designed to support concurrent access and modifications of the large collections of data.

UML class diagram for asynchronous results (futures) from the Java 7 java.util.concurrent package.

The Future<V> interface represents the result of an asynchronous computation, where type V is the result type returned by the Future‘s get method. Methods of this interface allow to wait for the computation to complete, to cancel execution of the task, to check if the computation is complete or was cancelled, and to retrieve the result of the computation.

The Delayed interface allows to mark objects that should be acted upon after a given delay. ScheduledFuture<V> interface extends both Future<V> and Delayed, and is usually a result of scheduling a task with a ScheduledExecutorService.

The FutureTask class is an implementation of Future that implements java.lang.Runnable as required by RunnableFeature interface, and thus may be executed by an Executor.

时间: 2024-11-15 17:17:55

Java Concurrency - java.util.concurrent API Class Diagram的相关文章

Jakob Jenkov 写的 java.util.concurrent API 指南

1. java.util.concurrent - Java 并发工具包 Java 5 添加了一个新的包到 Java 平台,java.util.concurrent 包.这个包包含有一系列能够让 Java 的并发编程变得更加简单轻松的类.在这个包被添加以前,你需要自己去动手实现自己的相关工具类.本文我将带你一一认识 java.util.concurrent 包里的这些类,然后你可以尝试着如何在项目中使用它们.本文中我将使用 Java 6 版本,我不确定这和 Java 5 版本里的是否有一些差异.

java.util.concurrent.locks lock锁【2】

Lock 锁介绍 JDK1.5以前,我们实现线程同步都是通过synchroized关键字进行方法或者语句块锁定,以保证该关键字作用域内的操作都是原子性操作. JDK1.5以后,提供的并发包提供了更强大的功能和更为灵活,最为关键的是需要手工释放锁,需要unlock必须在finally方法内.这是非常值得注意的事情. 介绍一下Lock接口.实现类有3个,分别是 普通锁,读写锁-写锁,读写锁-读锁. API文档给出了相近的说明和demo. Lock l = ...; l.lock(); try { /

[转载] java多线程学习-java.util.concurrent详解(四) BlockingQueue

转载自http://janeky.iteye.com/blog/770671 --------------------------------------------------------------------------------- 7.BlockingQueue     “支持两个附加操作的 Queue,这两个操作是:获取元素时等待队列变为非空,以及存储元素时等待空间变得可用.“ 这里我们主要讨论BlockingQueue的最典型实现:LinkedBlockingQueue 和Arra

[转载] java多线程学习-java.util.concurrent详解(一) Latch/Barrier

转载自http://janeky.iteye.com/blog/769965 Java1.5提供了一个非常高效实用的多线程包:java.util.concurrent, 提供了大量高级工具,可以帮助开发者编写高效.易维护.结构清晰的Java多线程程序.从这篇blog起,我将跟大家一起共同学习这些新的Java多线程构件 1. CountDownLatch     我们先来学习一下JDK1.5 API中关于这个类的详细介绍: “一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个

[转载] java多线程学习-java.util.concurrent详解(二)Semaphore/FutureTask/Exchanger

转载自http://janeky.iteye.com/blog/770393 ----------------------------------------------------------------------------- 3. Semaphore     我们先来学习一下JDK1.5 API中关于这个类的详细介绍: “一个计数信号量.从概念上讲,信号量维护了一个许可集.如有必要,在许可可用前会阻塞每一个 acquire(),然后再获取该许可.每个 release() 添加一个许可,从

[转载] java多线程学习-java.util.concurrent详解(三)ScheduledThreadPoolExecutor

转载自http://janeky.iteye.com/blog/770441 ---------------------------------------------------------------------------------- 6. ScheduledThreadPoolExecutor     我们先来学习一下JDK1.5 API中关于这个类的详细介绍: "可另行安排在给定的延迟后运行命令,或者定期执行命令.需要多个辅助线程时,或者要求 ThreadPoolExecutor 具

聊聊高并发(二十)解析java.util.concurrent各个组件(二) 12个原子变量相关类

这篇说说java.util.concurrent.atomic包里的类,总共12个.网上有非常多文章解析这几个类.这里挑些重点说说. 这12个类能够分为三组: 1. 普通类型的原子变量 2. 数组类型的原子变量 3. 域更新器 普通类型的原子变量的6个, 1. 当中AtomicBoolean, AtomicInteger, AtomicLong, AtomicReference分别相应boolean, int,  long, object完毕主要的原子操作 2. AtomicMarkableRe

java.util.concurrent.CountDownLatch

from when and where: CountDownLatch是在java1.5被引入的,跟它一起被引入的并发工具类还有CyclicBarrier.Semaphore.ConcurrentHashMap和BlockingQueue,它们都存在于java.util.concurrent包下. introduce: CountDownLatch这个类能够使一个线程等待其他线程完成各自的工作后再执行.例如,应用程序的主线程希望在负责启动框架服务的线程已经启动所有的框架服务之后再执行. func

java多线程学习--java.util.concurrent

CountDownLatch,api 文档:http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes. 假设我们要打印1-100,最