Page 1 of 2

using 100% of cpu

Posted: Sat Feb 02, 2013 7:52 am
by bwolfsohn
Reviewing old threads, it doesn't seem possible to determine what cpu an application is running on.

when starting up an app, (and testing it), i'm thinking of showing the cpu via spiking the cpu usage and viewing it in task manager.

This used to work on "slower machines", but it doesn't even cause a blip on my new machine when i test it from xdot

a:={1,2,3,0}
nSeconds:=seconds()
do while seconds() <= nSeconds+2
asort(a)
enddo

any suggestions ??

Brian

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 9:31 am
by RDalzell
Hi Brian,

Roger has DC_SetCpu(), which you can set the desired CPU, possibly a start?

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 9:38 am
by bwolfsohn
RDalzell wrote:Hi Brian,

Roger has DC_SetCpu(), which you can set the desired CPU, possibly a start?
Rick,

I'm using that... I want to spike the cpu being used at start-up so i can confirm in task manager that it's using that cpu..

Sometimes, the above function spikes the cpu, sometimes not.. but in my new machines, it hardly ever spikes it..

Brian

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 12:31 pm
by Auge_Ohr
hi,

what Value do you use for SmpSetCPU() ?

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 1:00 pm
by bwolfsohn
Auge_Ohr wrote:hi,

what Value do you use for SmpSetCPU() ?
nCpu:= val(dc_xtoc(DC_INIREAD('my.ini','something','CPU',@cTemp)))
SmpSetCPU(nCpu)

FUNCTION SmpSetCPU(nCpuMask)
******************
DllCall("Xpprt1.dll",DLL_CDECL, "_sysSetCPU", nCpuMask)

etc etc

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 6:31 pm
by Auge_Ohr
bwolfsohn wrote:nCpu:= val(dc_xtoc(DC_INIREAD('my.ini','something','CPU',@cTemp)))
SmpSetCPU(nCpu)
but what Value does nCpu have ? it must be 2^x

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 7:03 pm
by bwolfsohn
Jimmy,

nCpu is 3

there are 2 physical cpu's and each has 4 cores + hyperthreading.. so, in performance tab of taskbar, there are 16 windows

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 8:28 pm
by Auge_Ohr
bwolfsohn wrote:nCpu is 3
please try Alaska Sample c:\ALASKA\XPPW32\Source\samples\solution\smp\smprun.prg

as i can say Description is "old" while 3 for "CPU 1+2" will not work.
it can be only 1 CPU and it must be 1, 2, 4, 8, 16, 32 -> 2^x

Re: using 100% of cpu

Posted: Sun Feb 03, 2013 8:48 pm
by bwolfsohn
I've also tried 2 with no success

Re: using 100% of cpu

Posted: Mon Feb 04, 2013 1:14 pm
by Auge_Ohr
bwolfsohn wrote:I've also tried 2 with no success
hm ... are those CPU Xeon or "normal" ?