Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Multi-Core Processing

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.

like image 717
Get Off My Lawn Avatar asked Jan 03 '13 15:01

Get Off My Lawn


2 Answers

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.

like image 116
Peter Lawrey Avatar answered Sep 21 '22 13:09

Peter Lawrey


This is Oracle's tutorial about Java 7 fork/join framework

http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html

like image 30
Evgeniy Dorofeev Avatar answered Sep 23 '22 13:09

Evgeniy Dorofeev