[fpc-pascal] Optimal number of threads for SMP

Michael Schnell mschnell at lumino.de
Fri Sep 19 10:17:45 CEST 2014


On 09/15/2014 11:19 AM, Marco van de Voort wrote:
> too many threads increasing switching time and thus decreases performance

Not only this.

Additionally Linux tries to keep a thread/Task at the same CPU when 
re-scheduling the CPUs. By this the count of misses on the (primary) 
caches is decreased.

AFAIK, cache misses can result in a huge degradation.

Hence - depending on the task to be done - using more threads than CPUs 
might not be a good idea.

-Michael



More information about the fpc-pascal mailing list