S
Sanny
I have a function which I call using for loop. I want that when My
Java program is run on Dual Core its speed increases by twice and when
it run on Quad core its speed increase 4 time.
Here is the Code I am using.
const NUMBER=1000;
Public int int_x;
Public int[] Array1= new int[NUMBER];
init (){
for (int i=0;i<NUMBER;i++){
function_abc(i);
}
}
// function_abc returns same value for a given Value of "i".
function_abc(int i){
int_x++;
....
....
....
Array1=i*5+int_x;
}
So in the end we get an Array with the formula values. On a single
processor it goes through all the for loop in NUMBER times.
I want on Dual Core the Performance doubles by using Threads. So
function_abc(i); is Called in multiple threads and Speed increases X
times depending on number of X Processors the System has.
How can it be done, any idea.
So for Single Core it will have no spped increase.
For Dual Core Twice Speed
For Quad Core 4 Times speed is seen.
Bye
Sanny
Java program is run on Dual Core its speed increases by twice and when
it run on Quad core its speed increase 4 time.
Here is the Code I am using.
const NUMBER=1000;
Public int int_x;
Public int[] Array1= new int[NUMBER];
init (){
for (int i=0;i<NUMBER;i++){
function_abc(i);
}
}
// function_abc returns same value for a given Value of "i".
function_abc(int i){
int_x++;
....
....
....
Array1=i*5+int_x;
}
So in the end we get an Array with the formula values. On a single
processor it goes through all the for loop in NUMBER times.
I want on Dual Core the Performance doubles by using Threads. So
function_abc(i); is Called in multiple threads and Speed increases X
times depending on number of X Processors the System has.
How can it be done, any idea.
So for Single Core it will have no spped increase.
For Dual Core Twice Speed
For Quad Core 4 Times speed is seen.
Bye
Sanny