Page 1 of 1

CPU number limitations

Posted: Tue Mar 01, 2016 1:26 am
by Victorio
Have Alaska some limit for use CPU ?
(switching between CPU ?)

I want make application, from which will be via Runshell starting other xx exe modules, every on own core
I tested only CPU with 4 cores
but my client want use 12 cores ? Is it possible ? What is numbers for other cpu ?
1,2,4,8 for CPU 1 to 4
and other will be
16,32,64,... ?

Re: CPU number limitations

Posted: Tue Mar 01, 2016 7:05 am
by rdonnay

Code: Select all

   SetLogicalProcessor( RandomInt(GetLogicalProcessorCount()) )

Re: CPU number limitations

Posted: Tue Mar 01, 2016 4:29 pm
by Auge_Ohr
Victorio wrote:I want make application, from which will be via Runshell starting other xx exe modules, every on own core
you can switch CPU and use Runshell() and CMD will show it.
but when start any Xbase++ Application it will switch back to CPU 0 ... except Xbase++ App switch CPU itself.
Victorio wrote:but my client want use 12 cores ? Is it possible ? What is numbers for other cpu ?
1,2,4,8 for CPU 1 to 4
and other will be
16,32,64,... ?
2 ^ INT(nCPU-1)

Code: Select all

FUNCTION switchcpu(nCPU)
LOCAL nWorkCPU

   DEFAULT nCPU TO 1
   IF nCPU = 1
      SmpSetCPU(1)
   ELSE
      nWorkCPU  := 2 ^ INT(nCPU-1)

      IF SmpSetCPU(nWorkCPU) = 0
         SmpSetCPU(1)
      ENDIF
   ENDIF
   nWorkCPU := SmpGetCPU()

RETURN nWorkCPU

Re: CPU number limitations

Posted: Wed Mar 02, 2016 1:27 am
by Victorio
OK, I understand, I start external exe modules with parameter (numbercpu), then this exe run on this cpu.

My question was , if is some limit to number of CPU in alaska , or it is unlimited and controlled only with OS ? Can switch to cpu range from 1 to 12 ?
I have only 4core CPU, because I cannot examine it.

Re: CPU number limitations

Posted: Wed Mar 02, 2016 1:40 am
by Tom
You can switch between up to 64 CPUs -it's the same mechanism. Above this value, CPUs are grouped and it gets complicated. ;)