using 100% of cpu

This forum is for general support of Xbase++
Message
Author
bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

using 100% of cpu

#1 Post 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
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: using 100% of cpu

#2 Post by RDalzell »

Hi Brian,

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

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: using 100% of cpu

#3 Post 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
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Auge_Ohr
Posts: 1414
Joined: Wed Feb 24, 2010 3:44 pm

Re: using 100% of cpu

#4 Post by Auge_Ohr »

hi,

what Value do you use for SmpSetCPU() ?
greetings by OHR
Jimmy

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: using 100% of cpu

#5 Post 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
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Auge_Ohr
Posts: 1414
Joined: Wed Feb 24, 2010 3:44 pm

Re: using 100% of cpu

#6 Post 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
greetings by OHR
Jimmy

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: using 100% of cpu

#7 Post 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
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Auge_Ohr
Posts: 1414
Joined: Wed Feb 24, 2010 3:44 pm

Re: using 100% of cpu

#8 Post 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
greetings by OHR
Jimmy

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: using 100% of cpu

#9 Post by bwolfsohn »

I've also tried 2 with no success
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Auge_Ohr
Posts: 1414
Joined: Wed Feb 24, 2010 3:44 pm

Re: using 100% of cpu

#10 Post by Auge_Ohr »

bwolfsohn wrote:I've also tried 2 with no success
hm ... are those CPU Xeon or "normal" ?
greetings by OHR
Jimmy

Post Reply