On Mon, 29 May 2023, Hairy Pixels via fpc-pascal wrote:



On May 29, 2023, at 9:24 PM, Sven Barth via fpc-pascal 
<fpc-pascal@lists.freepascal.org> wrote:

FPC itself is single threaded. So for that the single thread rating is more 
important. However Lazarus (and fpmake) can parallelize the building of 
packages if they don't depend on each other. On the other hand this is only 
really important when rebuilding and not when doing normal builds.

I was curious about this, if the compiler was overhauled and it could be
made multi-threaded could it compile each unit on a different thread? Maybe it would be complicated but if a unit graph was constructed you
could isolate units that don't depend on each other and compile them on
their own threads right?

Theoretically, yes.

But there are some global structures that would need to be protected from
simultaneous access by the various threads (e.g. symbol tables).

It is far from sure this can be done in a manner that does not destroy the advantage of multi-thread. It could well be that the threads spend more
time waiting than actually compiling.


If I recall this is impossible currently because of the use of global variables.

Yes. There are lots of them.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to