The Java™ Tutorials — Concurrency :Executors

The Java™ Tutorials — Concurrency :Executors

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

关键点

  • Executor 接口定义了executor对象的三种类型
  • 线程池是最常见的一种executor实现
  • Fork/Join 是充分利用了多处理器的一种新架构(于 JDK 7 中推出)

全文翻译

In all of the previous examples, there’s a close connection between the task being done by a new thread, as defined by its Runnable object, and the thread itself, as defined by a Thread object. This works well for small applications, but in large-scale applications, it makes sense to separate thread management and creation from the rest of the application. Objects that encapsulate these functions are known as executors. The following subsections describe executors in detail.

  • Executor Interfaces define the three executor object types.
  • Thread Pools are the most common kind of executor implementation.
  • Fork/Join is a framework (new in JDK 7) for taking advantage of multiple processors.

在之前的例子中,由新线程正在执行的任务,也就是定义的Runnable对象,和新线程本身,也就是定义的Thread对象,有着很紧密的关系。这在小程序中非常合适,但对于大程序而言,讲线程的管理和创建从程序中抽离出来是更好的。封装此功能的对象被称为executor。下面的这些子章节将会详细讨论Executor。

  • Executor 接口定义了executor对象的三种类型
  • 线程池是最常见的一种executor实现
  • Fork/Join 是充分利用了多处理器的一种新架构(于 JDK 7 中推出)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值