[fpc-pascal] Single threaded application on multicore CPU

LacaK lacak at zoznam.sk
Wed Jun 22 09:02:19 CEST 2016


Hi *,

may be that this question is bit off-topic here, but I am sure, that 
here are experts, which know answer ;-)

I have simple Lazarus/FPC application (with no explicit threads) which 
does intensive calculations (local thresholding with big window size) on 
image, which is stored into memory as 2D byte array.
(so only memory access is done and some integer calculations)

When I run this application and look at Task Manager or Resource Monitor 
I see, that all 4 cores "are used" (at least performance graph shows 
usage or in other words activity in graph increasees)
Total CPU usage is <= 25% (which points out to fact, that only 1/4 cores 
is used)

Why this ? As far as I expect, that single threaded application should 
use only one core, so I would expect activity only on one core not on 
all four cores
(I know that in theory CPU can switch single thread between cores, but I 
doubt that this is case (as switching has extra cost)... or is ?)
(Btw: When I set affinity to only one core, then this core is 100% and 
others are 0% as expected)

Thanks

-Laco.




More information about the fpc-pascal mailing list