Using _sysSetCPU

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Using _sysSetCPU

#1 Post by omni »

Roger,

A while back you showed how to use the multi-core option. Works fine. Larger users now want to expand the usage to use more than 4.
the example you have uses up o 4 cpu's. They have 12 and the first 4 are getting real high, causing some slow downs.

Can it be expanded to use more? If so, does it matter on Alaska version? One still has 1.9. We are trying to get them all on 2.0, but still working on that.

We are using your dc_setcpu()

Thanks

Fred
Omni

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Using _sysSetCPU

#2 Post by rdonnay »

Did you try passing a larger number to DC_SetCPU() ?

//255 = 8 CPUs
//127 = 7 CPUs
// 63 = 6 CPUs
// 31 = 5 CPUs
// 15 = 4 CPUs
// 7 = 3 CPUs
// 3 = 2 CPUs
// 1 = 1 CPU
The eXpress train is coming - and it has more cars.

Victorio
Posts: 621
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Using _sysSetCPU

#3 Post by Victorio »

I am using this

function to swith to other CPU core :
prepnicpu(2^(cprocesora-1))

where cprocesora = 1,2,3,4,5,6,... , then 2^(cprocesora-1) = 1,2,4,6,8,16,...

FUNCTION PrepniCPU(nCpu)
IF SmpSetCPU(nCpu) = 0
msgbox("Cannot swith to CPU : " + var2char(nCpu))
ELSE
msgbox("App switched to CPU : " + Var2char(BitSet2Array(nCpu) ) )
ENDIF
RETURN nil

this works fine also on 12 core Windows 2012 server

As I remember, Jimmy was wrote, when other number, 3,5,... then works more than one CPU simultaneously

Now I cannot test this because I have not access to this server, on virtual servers number of CPU can be big number ... 24 or other,

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: Using _sysSetCPU

#4 Post by unixkd »

Hi Victorio

Where in your application do you call this function.

Thanks

Joe

Victorio
Posts: 621
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Using _sysSetCPU

#5 Post by Victorio »

I start main application, from this I call several other modules by Runshell and put parameter number CPU for every module
runshell(" 1",program.exe... blabla)
runshell(" 2",program.exe... blabla)
runshell(" 3",program.exe... blabla)

and every "program.exe" start on own CPU.

In one "exe" cannot run more CPU core, only one. I know from this forum, it is not way to run other thread in same program on other CPU....

My application works fine, I am using it for divide big processes to 12 CPU, and time to processing is then about 1/12 time if compare to work only on one CPU.

Post Reply