I have a problem in cpu usage.
My PC: X86- Intel Core 2 duo 2.2GHz - WinXP-SP2-RAM 2GB FSB 1066

my CPU usage was not above 50% until last week! so > Very slow run >large run times. (my codes had 100% CPU usage in single core PCs.)
I asked from a friend and he said that in this multy core CPUs, non threaded codes may only use 1 core! he was right!
i convert my code to treaded type, my total CPU usage rised up! but only to 65-70% not to 100%. and my run time increased too!!!!
but i wrote a simple treaded code that contained no matrix, array,...
the cpu usage reached 98%!!!!
one of my friends said that "when you use a matrix or array instead of single integer in maple, your run time will be badly increase, because your total CPU usage will decrease! i't a result of delay in matrix  element process in ram and as CPU has no command to process and is waiting for data from RAM, so your CPU usage will be in IDLE in ... %"

i think that he was right. What do you think? What should i do?
IS it usual that when we use matrix for same calculation our run time will increase?
for this purpose i wrote a simple multi-threaded test code! you can run any optional code with matrix and without. mabe my coding is wrong!!!

but this type codes will have diffrent CPU Usages in diffrent PCs!!!

my friends reported: 85%-65%-70%,...

file name: "test.mws"> run with classic worksheet (has a better speed)

-----------------------------------------------------------------------------------------

restart;
with(Threads);

Post1:=proc()
M:=Matrix(30000000,1);
M[1,1]:=0;
for i from 2 to 30000000 do
M[i,1]:=M[i-1,1]+1:
end do: end proc;

Post2:=proc()
M2:=Matrix(30000000,1);
M2[1,1]:=0;
for i from 2 to 30000000 do
M2[i,1]:=M2[i-1,1]+1:
end do: end proc;

Threads:-Wait( Threads:-Create( Post1( ) ),Threads:-Create( Post2( ) ) );

------------------------------------------------------------------------------------

You can test the problem only on multi cores CPUs with WINXP SP2. if you run it you can see that the CPU usage would not be the maximum in some PCs! it depends on your CPU speed! your run time will be increase than when no matrix !
your run time will be higher than when you do not use threaded coding!
I belive that there is a way in maple to wrote more faster codes. because many students calculates their difficult problems in maple. and if they should wait as much as me to get result no science development would be exist!!!

please help me


Please Wait...