Serial Algorithm vs. Parallel Algorithm
In order to solve your problem, you will need to change your algorithm.
Today what you have is an application that runs all its logic on a single thread that will be run by a single processor. This is called a serial algorithm or sequential.
What it means to say that all of your logic runs sequentially. You would have to rewrite part of your application by splitting it into subtasks - subtasks, and handing them to threads - this would be the parallel algorithm. An addendum can not parallelize your entire algorithm, you can only divide up to a certain point.
The number of threads must be the number of processors available, and for each thread you submit your tasks. Each thread is executed by a processor. Do not confuse parallel computing with concurrent programming.
Other technology such as .net and Java are already ready to use
to efficiently multi-core CPUs?
Java has always provided APIs and frameworks for concurrent programming and parallel computing. From Java 1.5 a framework called Executor Framework has been added. It provides several utilitarian classes, interfaces, methods for manufacturing Thread Pools, and methods of submitting tasks.
In Java 1.7 we have already won the Fork / Join framework . By allowing you to program an algorithm by setting Thresholds , which are boundaries, when this threshold is reached you want the task in two-fork. Once it is executed and the other tasks are completed, you make the joys of them for the end result. Interestingly, this framework implements an algorithm called work-stealing . This is a technique where when a thread finishes executing its task it steals the task from another thread that has not yet finished its execution.
Last but not least
If you take on the project of migrating a new execution template, I recommend that you study the Amdahl's law that predicts the maximum amount of time it is possible to optimize a program using multiple processors.
Sources:
Serial Algorithm: link
Parallel algorithm: link
Parallel computing: link