Author | Topic: Multi Core USING with one EXE | |
---|---|---|
Daniel Faus | Multi Core USING with one EXE on Mon, 27 Apr 2020 20:04:24 +0200 Hi everyone... I noticed that when I'm reindexing a DBF file the CPU is full 100%, but only one core, the other cores are not used. When I execute an EXE this use one core too, but I don't know haow to use the other cores at the same time, I can choose the core that I'm going to use, but I would like to use 2 or 3 cores to do some tasks that need more. Can I do this? Right now I'm selecting the core to start my app, from 2 to max, I keep first core to do operating system processes Uso de otro procesador logico para descarga del principal... If GetLogicalProcessorCount() > 1 nCPU := RandomInt(2,GetLogicalProcessorCount() ) SetLogicalProcessor( nCPU ) Aleatorio hasta el maximo de CPU ... Else nCPU := 1 EndIf But I want to use 2 or more cores to do the same process, like reindex... The only way I think to do this operations is to open new threads, but each thread use only one core... Thread():new() Many thanks Daniel | |
Jan Escholt | Re: Multi Core USING with one EXE on Mon, 27 Apr 2020 20:29:15 +0200 Xbase++ programs can only use one core. You can choose witch one, but only one. Jan Am 27.04.2020 um 20:04 schrieb Daniel Faus: > Hi everyone... > > I noticed that when I'm reindexing a DBF file the CPU is full 100%, but > only one core, the other cores are not used. > > When I execute an EXE this use one core too, but I don't know haow to > use the other cores at the same time, I can choose the core that I'm > going to use, but I would like to use 2 or 3 cores to do some tasks that > need more. > > Can I do this? > > Right now I'm selecting the core to start my app, from 2 to max, I keep > first core to do operating system processes > > Uso de otro procesador logico para descarga del principal... > If GetLogicalProcessorCount() > 1 > nCPU := RandomInt(2,GetLogicalProcessorCount() ) > SetLogicalProcessor( nCPU ) Aleatorio hasta el maximo de CPU ... > Else > nCPU := 1 > EndIf > > But I want to use 2 or more cores to do the same process, like reindex... > > The only way I think to do this operations is to open new threads, but > each thread use only one core... Thread():new() > > Many thanks > > Daniel |