4 ways to do concurrency in Java: Threads, Executors, ForkJoin and Actors

4 ways to do concurrency in Java: Threads, Executors, ForkJoin and Actors (0 messages)
在Java中的四种并行方式:Threads, Executors, ForkJoin and Actors 
POSTED BY: Oleg Šelajev
来自:Oleg Šelajev
POSTED ON: December 11 2014 08:01 EST
时间:2014/12/11 

  Humanity has come up with a number of solutions and models for concurrent computations that emphasize different parts of the problems, as well as making different choices for the computational tradeoffs that occur when we talk about achieving parallelism.
人们为了强调并行计算不同部分的问题提出许多解决类和模型,我们在谈论关于实现并行时也要对计算发生的权衡做出不同的选择。


In this post we’ll go over the following methods and approaches to enable concurrent processing and asynchronous code in Java, we'l talk about benefits, drawbacks and the best use cases for: 
在这里我们将重温下面的方法并且可以获得在Java中执行并行和异步的方法,我们将讨论其中的优点和缺点以及最佳的使用案例:
Bare Threads
Bare Threads
Executors & Services
Executors & Services
ForkJoin framework and parallel streams
ForkJoin模式和并行流

Actor model

Actor 模型

And to make things more interesting, we didn’t just provide any kind of code to illustrate the approach, but used a common task, so the code in every section is more or less equivalent to each other.
并且为了更有趣,我们不仅会提供各种类型的代码,也会使用通俗的作业,所以每个部分的代码都差不多是等价的。
Continue reading the full article on RebelLabs: 
http://zeroturnaround.com/rebellabs/flavors-of-concurrency-in-java-threads-executors-forkjoin-and-actors/
阅读文章请戳:
 http://zeroturnaround.com/rebellabs/flavors-of-concurrency-in-java-threads-executors-forkjoin-and-actors/



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值