[fpc-pascal] Optimal number of threads for SMP

Sven Barth pascaldragon at googlemail.com
Sat Sep 20 12:03:25 CEST 2014


On 20.09.2014 01:48, Graeme Geldenhuys wrote:
> On 2014-09-15 10:19, Marco van de Voort wrote:
>> My rule of thumb is physical cores + a percentage. (like 10-20%).
>
> Tell that to most developers out there, they clearly don't know that
> "rule of thumb". :-)  Mozilla Thunderbird under Win7 shows 47 threads.
> EditPad Pro 7 shows 18 threads. etc etc... I only have a mere dual-core
> system.

And look at that, I'm sure that you have more than one process running.

Only because there are 47 or 18 threads does not mean that every thread 
is doing something right now. Most threads in those applications are 
just waiting (blocking) for the right event to trigger them to do 
something. And in that case the "rule of thumb" doesn't help much. But 
when we're talking about really active threads that do calculate 
something or so then the "rule of thumb" is quite good, because 
otherwise there will be more thread switching between the threads your 
program has (plus the other threads of other processes) than when you 
only have a bit more threads active than cores.

Regards,
Sven




More information about the fpc-pascal mailing list