CPU number limitations

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
Victorio
Posts: 621
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

CPU number limitations

#1 Post 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,... ?

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

Re: CPU number limitations

#2 Post by rdonnay »

Code: Select all

   SetLogicalProcessor( RandomInt(GetLogicalProcessorCount()) )
The eXpress train is coming - and it has more cars.

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

Re: CPU number limitations

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

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

Re: CPU number limitations

#4 Post 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.

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: CPU number limitations

#5 Post 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. ;)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply