Reputation: 36299
I would like to learn about Java's multi-core processing. From what I understand, is that Threading
is one type of multi-core, which I feel I have a decent grasp of. I know there are other ways to do multi-core processing, but I don't know what they are. Does anyone know of any good simple tutorials/examples, or have their own that I could look at to learn more about multi-core processing in Java?
All the tutorials that I have found get too in depth with charts, graphs, background information, etc. and that really isn't my learning style with programming. I would preferably like something quick and simple.
Upvotes: 7
Views: 10526
Reputation: 13515
Beyond the mentioned High Level Concurrency Objects (fork/join should be added there) which are part of the Java implementation, there are many libraries and frameworks. Google for "actor framework", "dataflow framework", mapreduce, "scientific dataflow". The dataflow model is the mainstream, all other are it's variations (e.g. actor - dataflow node with single input port, mapreduce - persistent distributed actors created by demand, etc). The minimal dataflow framework (no persistence or distribution over a machine cluster) is mine df4j library.
Upvotes: 0
Reputation: 135992
This is Oracle's tutorial about Java 7 fork/join framework
http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html
Upvotes: 3
Reputation: 533442
The primary way you use multiple cores is to use multiple threads. The simplest way to use these if via the High Level Concurrency Objects which you should be familar with. This uses threads but you don't have to deal with them directly.
Another way is to use multiple processes, but this is an indirect way of using multiple threads.
You might find this library interesting. Java Thread Affinity It allows you to assign thread to sockets, cores or cpus.
Upvotes: 8