Forum > Linux

Build lazarus and fpc in linux is not support multi thread.

<< < (3/3)

MarkMLl:

--- Quote from: PascalDragon on May 17, 2022, 09:09:36 am ---In general a linker could parallelize the reading of the object files. Most everything else is probably too serialized...

--- End quote ---

The async callbacks provided by the Windows (originally OS/2) API might arguably favour heavy multithreading in a way that the unix API doesn't. Or it might be that the MSVC linker actually suffers from being written as a multithreaded program and /demands/ lots of CPUs/cores.

As a potential point of debate, I'd suggest that an OS should or at least could throw spare CPUs/cores at the job of keeping the various buffers and caches needed by the linker full. In any event, sooner or later one hits the limit of how much traffic can pass through the kernel down to a small number of physical storage devices accessed via a small number of busses.

Of course, if one looks at one of the most frequently examined cases that can benefit from make -j, i.e. a Linux kernel rebuild, one notices that most of the code- i.e. almost all the drivers etc.- is saved in the form of .ko files. Multiple .ko files are definitely built in parallel, but I don't know to what extent the fairly small number of intermediate files which are linked to build a .ko are built in parallel.

If OP wants to make a case for change, then I think he needs to provide convincing evidence that an individual Linux .ko benefits from parallelisation, and then demonstrate that FPC's building an individual package is significantly less efficient... which together would be a fairly hefty analysis job, allowing for the number of .ko files and packages being built simultaneously.

And in any event, he'd have to demonstrate that any change was both compatible with fpcmake (which is central to the wide variety of targets FPC supports) and with things like generics.

MarkMLl

PascalDragon:

--- Quote from: MarkMLl on May 17, 2022, 09:35:00 am ---Of course, if one looks at one of the most frequently examined cases that can benefit from make -j, i.e. a Linux kernel rebuild, one notices that most of the code- i.e. almost all the drivers etc.- is saved in the form of .ko files. Multiple .ko files are definitely built in parallel, but I don't know to what extent the fairly small number of intermediate files which are linked to build a .ko are built in parallel.
--- End quote ---

The object files are also compiled in parallel. Otherwise there wouldn't be any benefit when building a full static kernel (one that has all drivers compiled in).


--- Quote from: MarkMLl on May 17, 2022, 09:35:00 am ---If OP wants to make a case for change, then I think he needs to provide convincing evidence that an individual Linux .ko benefits from parallelisation, and then demonstrate that FPC's building an individual package is significantly less efficient... which together would be a fairly hefty analysis job, allowing for the number of .ko files and packages being built simultaneously.
--- End quote ---

This is not comparable and also not applicable. In the C world C files can be build in parallel, because they don't depend on each other (declarations and such are in separate header files that are simply included by each). This is not the case for FPC, because units have dependencies between each other and the compiler simply can't continue compiling a unit until all dependencies of that unit are solved.

Navigation

[0] Message Index

[*] Previous page

Go to full version