Talk:Taking advantage of multi core/multi threading machines

From Free Pascal wiki
Jump to navigationJump to search

Build system

(Marco: 2 cpu's : 3-4 threads 4 CPU's : 6-8 threads)

If the compiler is multithreaded as well and if it can start e.g. the assembler in an asynchronous process and e.g. the rtl is auto multithreaded too (memory manager: freemem could be done asynchronious by a low priority thread) it's not that easy :) You need to distribute the resources hierachically then. --FPK 22:24, 5 Feb 2006 (CET)

(Marcov: good point. detailed Profiling info of the compilation process, with better granularity than the overall runtime would certainly help :-)

make -j 2

Parallel compilation using make -j 2 currently fails miserably because if two packages use a third unit, two compilers can start compiling that unit at once. Because of this package dependencies alone are not enough; a make tool would need to scan the source code of two packages to check if they are really independend.

Proper package dependencies are enough as long as a make all is done because then all packages which are used by the current ones are compiled before --FPK 22:21, 5 Feb 2006 (CET)

Marco: make -j 2 is too expensive due to constant restarting of the compiler anyway. It is faster to let FPC compile a few units single threaded in one run, than to let it really compile parallel using -j 2 (iow with multiple processes). This also because due to caching of ppu's, disc traffic for the overall process is less.

make -j 2 should work only on a package basis of course, i.e. one processor could compile packages/gtk while the other compiles packages/gtk2, all this is interwinded with the new package system --FPK 22:21, 5 Feb 2006 (CET)