- 浏览: 3016643 次
- 性别:
- 来自: 海外
文章分类
- 全部博客 (430)
- Programming Languages (23)
- Compiler (20)
- Virtual Machine (57)
- Garbage Collection (4)
- HotSpot VM (26)
- Mono (2)
- SSCLI Rotor (1)
- Harmony (0)
- DLR (19)
- Ruby (28)
- C# (38)
- F# (3)
- Haskell (0)
- Scheme (1)
- Regular Expression (5)
- Python (4)
- ECMAScript (2)
- JavaScript (18)
- ActionScript (7)
- Squirrel (2)
- C (6)
- C++ (10)
- D (2)
- .NET (13)
- Java (86)
- Scala (1)
- Groovy (3)
- Optimization (6)
- Data Structure and Algorithm (3)
- Books (4)
- WPF (1)
- Game Engines (7)
- 吉里吉里 (12)
- UML (1)
- Reverse Engineering (11)
- NSIS (4)
- Utilities (3)
- Design Patterns (1)
- Visual Studio (9)
- Windows 7 (3)
- x86 Assembler (1)
- Android (2)
- School Assignment / Test (6)
- Anti-virus (1)
- REST (1)
- Profiling (1)
- misc (39)
- NetOA (12)
- rant (6)
- anime (5)
- Links (12)
- CLR (7)
- GC (1)
- OpenJDK (2)
- JVM (4)
- KVM (0)
- Rhino (1)
- LINQ (2)
- JScript (0)
- Nashorn (0)
- Dalvik (1)
- DTrace (0)
- LLVM (0)
- MSIL (0)
最新评论
-
mldxs:
虽然很多还是看不懂,写的很好!
虚拟机随谈(一):解释器,树遍历解释器,基于栈与基于寄存器,大杂烩 -
HanyuKing:
Java的多维数组 -
funnyone:
Java 8的default method与method resolution -
ljs_nogard:
Xamarin workbook - .Net Core 中不 ...
LINQ的恶搞…… -
txm119161336:
allocatestlye1 顺序为 // Fields o ...
最近做的两次Java/JVM分享的概要
Java theory and practice: Stick a fork in it
汗...
Java 7不愧是kitchen-sink...不过这东西看起来又挺实用的,有些时候虽然觉得(在多处理器/多核心环境下)有些地方应该开多线程来做,不过要自己管理那么多东西也确实怪麻烦的。看一例子:
不过这东西要是能配合匿名方法/闭包来做就更简洁了。
话说,Greg Wilson很明显对这东西不感冒。一提到调试器,这并行计算的痛处就又来了一个……
引用
One of the additions to the java.util.concurrent packages coming in Java™ 7 is a framework for fork-join style parallel decomposition. The fork-join abstraction provides a natural mechanism for decomposing many algorithms to effectively exploit hardware parallelism.
汗...
Java 7不愧是kitchen-sink...不过这东西看起来又挺实用的,有些时候虽然觉得(在多处理器/多核心环境下)有些地方应该开多线程来做,不过要自己管理那么多东西也确实怪麻烦的。看一例子:
引用
Listing 3. Solving the select-max problem with the fork-join framework
public class MaxWithFJ extends RecursiveAction { private final int threshold; private final SelectMaxProblem problem; public int result; public MaxWithFJ(SelectMaxProblem problem, int threshold) { this.problem = problem; this.threshold = threshold; } protected void compute() { if (problem.size < threshold) result = problem.solveSequentially(); else { int midpoint = problem.size / 2; MaxWithFJ left = new MaxWithFJ(problem.subproblem(0, midpoint), threshold); MaxWithFJ right = new MaxWithFJ(problem.subproblem(midpoint + 1, problem.size), threshold); coInvoke(left, right); result = Math.max(left.result, right.result); } } public static void main(String[] args) { SelectMaxProblem problem = ... int threshold = ... int nThreads = ... MaxWithFJ mfj = new MaxWithFJ(problem, threshold); ForkJoinExecutor fjPool = new ForkJoinPool(nThreads); fjPool.invoke(mfj); int result = mfj.result; } }
不过这东西要是能配合匿名方法/闭包来做就更简洁了。
话说,Greg Wilson很明显对这东西不感冒。一提到调试器,这并行计算的痛处就又来了一个……
发表评论
-
The Prehistory of Java, HotSpot and Train
2014-06-02 08:18 0http://cs.gmu.edu/cne/itcore/vi ... -
MSJVM and Sun 1.0.x/1.1.x
2014-05-20 18:50 0当年的survey paper: http://www.sym ... -
Sun JDK1.4.2_28有TieredCompilation
2014-05-12 08:48 0原来以前Sun的JDK 1.4.2 update 28就已经有 ... -
IBM JVM notes (2014 ver)
2014-05-11 07:16 0Sovereign JIT http://publib.bou ... -
class data sharing by Apple
2014-03-28 05:17 0class data sharing is implement ... -
Java 8与静态工具类
2014-03-19 08:43 16144以前要在Java里实现所谓“静态工具类”(static uti ... -
Java 8的default method与method resolution
2014-03-19 02:23 10338先看看下面这个代码例子, interface IFoo { ... -
HotSpot Server VM与Server Class Machine
2014-02-18 13:21 0HotSpot VM历来有Client VM与Server V ... -
Java 8的lambda表达式在OpenJDK8中的实现
2014-02-04 12:08 0三月份JDK8就要发布首发了,现在JDK8 release c ... -
GC stack map与deopt stack map的异同
2014-01-08 09:56 0两者之间不并存在包含关系。它们有交集,但也各自有特别的地方。 ... -
HotSpot Server Compiler与data-flow analysis
2014-01-07 17:41 0http://en.wikipedia.org/wiki/Da ... -
字符串的一般封装方式的内存布局 (1): 元数据与字符串内容,整体还是分离?
2013-11-07 17:44 22259(Disclaimer:未经许可请 ... -
字符串的一般封装方式的内存布局
2013-11-01 12:55 0(Disclaimer:未经许可请 ... -
关于string,内存布局,C++ std::string,CoW
2013-10-30 20:45 0(Disclaimer:未经许可请 ... -
对C语义的for循环的基本代码生成模式
2013-10-19 23:12 21745之前有同学在做龙书(第二版)题目,做到8.4的练习,跟我对答案 ... -
Java的instanceof是如何实现的
2013-09-22 16:57 0Java语言规范,Java SE 7版 http://docs ... -
oop、klass、handle的关系
2013-07-30 17:34 0oopDesc及其子类的实例 oop : oopDesc* ... -
Nashorn各种笔记
2013-07-15 17:03 0http://bits.netbeans.org/netbea ... -
《深入理解Java虚拟机(第二版)》书评
2013-07-08 19:19 0值得推荐的中文Java虚拟机入门书 感谢作者赠与的样书,以下 ... -
豆列:从表到里学习JVM实现
2013-06-13 14:13 48121刚写了个学习JVM用的豆列跟大家分享。 豆列地址:http: ...
相关推荐
Java 语言从一开始能够支持线程和并发性;该语言包括像 synchronized 和 volatile 这样的同步原语,而类库包含像 Thread 这样的类。然而,1995 年流行的并发原语反映了当时的硬件现状:大多数商用系统根本没有提供...
看了下Java Tutorials中的fork/join章节,整理下。 什么是fork/join框架 fork/join框架是ExecutorService接口的一个实现,可以帮助开发人员充分利用多核处理器的优势,编写出并行执行的程序,提高应用程序的...
关于Java8 inAction所有的Demo 非常的实用,全部来自本人亲人编写 放心使用
and improve Java's fork-join framework * The long-awaited introduction of a well-designed date/time/calendar library (JSR 310) * Annotations on Java types to support useful pluggable type checkers and...
The directory <Java home>/sample/forkjoin/ contains samples that demonstrate the fork/join framework. The ThreadLocalRandom class eliminates contention among threads using pseudo-random numbers; see ...
Chapter 5, Fork/Join Framework will teach the readers to use the new Java 7 Fork/Join framework. It’s a special kind of executor oriented to execute tasks that will be divided into smaller ones using...
"Java 7 Concurrency Cookbook" includes recipes to enable you to achieve everything from the basic management of threads and tasks, to the new Fork /Join framework, through synchronization mechanisms ...
he Definitive Guide to Lambda Expressions Mastering Lambdas: Java ... the fork/join framework, and exceptions Examining stream performance with microbenchmarking API evolution using default methods
并行编程Coursera Java并行编程( )
He is the author of the book, Java 7 Concurrency Cookbook and Mastering Concurrency Programming with Java 8 by Packt. Table of Contents Thread Management Basic Thread Synchronization Thread ...
Design concurrent applications by converting a sequential algorithm into a concurrent oneDiscover how to avoid all the possible problems you can get in concurrent algorithmsUse the Executor framework ...
The chapter on threads follows this up and discusses everything from the very basic concepts of a thread to the most advanced topics such as synchronizers, the fork/join framework, and atomic ...
从自己管理Java线程,到各种更好几的解决方法,Executor服务、ForkJoin 框架以及计算中的Actor模型。 Java并发编程的4种风格:Threads,Executors,ForkJoin和Actors 我们生活在一个事情并行发生的世界。自然...
* Fork/Join framework to enhance the performance of your application * Parallel streams to process big sets of data in a parallel way, including the new Java 9 reactive streams * Data structures for ...
In Part 2, you learn about concurrency utilities basics and executors, synchronizers, the Locking Framework, and the additional capabilities of concurrent collections, atomic variables, and the Fork/...
实践中的Java并发和多线程 这是发行的的代码存储库。 它包含从头到尾完成视频课程所需的所有支持项目文件。...使用流行的并行Java框架(包括ForkJoin和Streams函数)构建高效,优雅的代码 主React式流以处理数据 探索
In Part 2, you learn about concurrency utilities basics and executors, synchronizers, the Locking Framework, and the additional capabilities of concurrent collections, atomic variables, and the Fork/...