#The Java™ Tutorials — Concurrency :High Level Concurrency Objects 高并发对象

The Java™ Tutorials — Concurrency :High Level Concurrency Objects 高并发对象

原文地址:https://docs.oracle.com/javase/tutorial/essential/concurrency/highlevel.html

全文翻译

So far, this lesson has focused on the low-level APIs that have been part of the Java platform from the very beginning. These APIs are adequate for very basic tasks, but higher-level building blocks are needed for more advanced tasks. This is especially true for massively concurrent applications that fully exploit today’s multiprocessor and multi-core systems.

到目前为止,课时都在关注低级别API,它们在一开始就成为了Java平台的一部分。这些API适用于非常基础的任务。但是对于更高级别的任务而言,就需要创建更高级别的构建,有其针对于充分利用了今天的多处理器和多核系统的高并发程序。

In this section we’ll look at some of the high-level concurrency features introduced with version 5.0 of the Java platform. Most of these features are implemented in the new java.util.concurrent packages. There are also new concurrent data structures in the Java Collections Framework.

  • Lock objects support locking idioms that simplify many concurrent applications.
  • Executors define a high-level API for launching and managing threads. Executor implementations provided by java.util.concurrent provide thread pool management suitable for large-scale applications.
  • Concurrent collections make it easier to manage large collections of data, and can greatly reduce the need for synchronization.
  • Atomic variables have features that minimize synchronization and help avoid memory consistency errors.
  • ThreadLocalRandom (in JDK 7) provides efficient generation of pseudorandom numbers from multiple threads.

本章节中我们将见到在Java 5.0 平台推出的几个高并发特性。大部分这些特性都在新的java.util.concurrent包中实现。在Java集合框架中,也有几种新的并发数据结构。

  • Lock对象支持锁的惯用方法,这大大简化了很多并发程序的开发。
  • Executor定义了一个高版本API,它可以执行和管理现场。由java.util.concurrent提供的Executor实现支持线程池的管理,这对大型应用十分合适。
  • 并发集合让大规模数据集的管理更加简单,并可以大量减少使用同步的需要。
  • 原子变量具有最小同步的特性,可用于避免内存一致性错误
  • ThreadLocalRandom(于JDK 7推出)提供了多线程下创建伪随机数的高效方法
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值