Multicore processing

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

Multicore processing

#1 Post by omni »

Roger,

I know this is a new hardware issue (recent years at least) but I have been asked by a user if we have a method to do multi-core processing.
This user has 50-70 users all running on one server that has quad cores. During the day within our app (the only one really running) the core "0" gets to 100% on a fairly regular basis. Then users start crashing (cannot even read dll files, much less open files). its normally momentary, but as you can imagine it really gets slow.

Is there a method that we can use as a software vendor to run different threads to different cores?

From what I have read, it is up to the software app to do the thread routing to cores. Just do not know if alaska has a method, or if ADS has one?

I thought I would start asking here.

Thanks,

Fred
Omni

PS: I guess I was asleep by the time you and Bobby were partying at the piano. There should have been pictures.

User avatar
sdenjupol148
Posts: 151
Joined: Thu Jan 28, 2010 10:27 am
Location: NYC

Re: Multicore processing

#2 Post by sdenjupol148 »

Hey Fred,

Sorry we missed you at the piano.

Look at Rogers DC_SetCpu() function.
This might be just the thing you need.

Next conference, no excuses; everybody sings. :dance:

Bobby

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: Multicore processing

#3 Post by omni »

Bobby,

Cannot find that in my version of express. When was this done?
I am still on build 254.

Fred

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

Re: Multicore processing

#4 Post by unixkd »

Hi,

The Advantage Database itself support multiple processors. This is stated in the ADS doc as follows:

All versions of the Advantage Database Server are multi-threaded and will perform each user-requested database operations concurrently or in parallel if multiple processors are present. Advantage Database Server allows the configuration of the number of "worker" threads that are used to perform individual database operations. See Number of Worker Threads (-T) for more information on Advantage Database Server worker threads and how to configure the number of them.

The Advantage Database Server for Windows is a multi-threaded Win32 Service that will automatically use multiple CPUs if available. Thus, user-requested database operations will be performed in parallel on multi-CPU Windows servers.

The Advantage Database Server for Linux is a multi-threaded daemon that will automatically use multiple CPUs if available and if using a Linux kernel that supports multi-processing. Thus, user-requested database operations will be performed in parallel on multi-CPU Linux servers.

The client applications utilises the workstation CPUs irrespective of where your .exe/.dll files are located. You can run each thread in your application on the CPU-core with the least load by Executing DC_SetCpu() function prior to :start() method of your thread.

Joe

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: Multicore processing

#5 Post by omni »

So, to clarify, its valid only in ADS? Or, are you saying that ads also has it.

This user is not utilizing ads, although its been recommended..he is trying to resolve on his own at the moment.

Fred

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Multicore processing

#6 Post by Cliff Wiernik »

I don't use dc_SetCPU() but am likely using something just like that. It is used on local workstations with multiple cores or servers with multiple processors/cores. For example, on a Windows Remote Desktop Server, with 2 4 core cpus, the application is run across all 8 cores. I assign mine randomly so it is not always evenly distributed, but it could be set to assign them in a round-robin approach so it is evenly distributed.

Cliff.

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: Multicore processing

#7 Post by omni »

Cliff,

I have downloaded 258 and now see it in the dclipx. Do not see any example of exactly how to implement it, other than, I assume, it should start with each thread when we open a menu item. Just not sure how to type in the command.
Roger, can you help on this..just what the syntax is and where to put it.

For example, my menu items are ACTION { || MDIBlock( { || Ldnotes() } ) }

My mdiblock is:

oThread := Thread():new()
close all
do qcolor ///sets system set up vars
oThread:start( bAction )
close all
RETURN

where baction is ldnotes()


Thanks

Fred
Omni

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

Re: Multicore processing

#8 Post by bwolfsohn »

Fred,

setcpu is for the entire application, not for individual threads.
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: Multicore processing

#9 Post by Auge_Ohr »

hi,

Xbase++ will ALLWAYS work on 1 CPU and all Thread are working on same.
but you can switch CPU every 0.1 sec NOT getting more Power but CPU can "cool down" not used CPU
here is an Example which use all you CPU with < 100 %

Code: Select all

   oTimer := Thread():new()
   oTimer:setInterval(10)
   oTimer:start("switchcpu",nMaxCPU)
here some Demo ( look into you Taskmanager -> CPU ) how different it will use CPU
MoreCPU_Demo.zip
(22.63 KiB) Downloaded 894 times
greetings by OHR
Jimmy

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

Re: Multicore processing

#10 Post by unixkd »

Hi Jim

Please post the code for the "switchcpu" function.

Thanks.

Joe

Post Reply