4 ways to do concurrency in Java: Threads, Executors, ForkJoin and Actors
2015-01-09 21:08
567 查看
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/
在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/
相关文章推荐
- 3 ways to do WCF Concurrency Management(Single, Multiple, and Reentrant and How to do with Throttling)
- 转一篇blog,这个人思路蛮清晰的 [do you want to work for a company with uninvolved management and a sweatshop mentality in which you occasionally see those people superior to you?]
- 《Java Concurrency in Practice》ch11 Performance and Scalability
- Locking and Concurrency in Java Persistence 2.0
- How to create and execute JAR file in Java – Command line Eclipse Netbeans
- PH FIN want to have PR/PO in TWD and SGD but do invoice matching and payment in USD
- How to use equals( ) and equalsIgnoreCase( ) in Java
- How to run eclipse in clean mode? and what happens if we do so?
- When to use comparable and comparator interfaces in java
- How to Create and Evaluate XPath Expression in Java - Tutorial and Example
- BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
- how to save a c++ object in java object and use it
- android in practice_Threads and concurrency
- Java Program to print Prime numbers in Java - Example Tutorial and Code
- java.lang.IllegalArgumentException: Invalid <url-pattern> toDo in 
- How to determine negative number and positive number in Java?
- Fork and Join: Java Can Excel at Painless Parallel Programming Too!
- Hashtable and HashMap are two hash based collection in Java and used to store objects as key value p
- How to create Immutable Class and Object in Java - Tutorial Example
- How to check for and disable Java in OS X