[fpc-devel] Parallel processing in the compiler

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Sep 4 21:55:44 CEST 2010


On 04 Sep 2010, at 19:41, Hans-Peter Diettrich wrote:

> Every parallel processing requires that all related data is private to every thread. Since some time I'm trying to eliminate such (currently) global variables. Now ppudump turned into an show stopper, due to the unsystematic and obscure unit dependencies in the compiler:

I think it is quite systematic and logical that the ppu loading should not depend on code generator internals.

> Hans-Peter Diettrich schrieb:
>> Jonas Maebe schrieb:
>>> ppudump probably does not depend on cpubase in trunk. cpubase is part
>>> of the code generator, and therefore the ppu loading should in fact
>>> not depend on it (directly nor indirectly).
>> Apart from that (minor) issue, can you review my work? It would be helpful to learn what's considered okay and what not.
> 
> In the meantime I've implemented another version, that does not have the above problem - but further development is impossible because the problem reappears with every of the remaining global variables. Therefore I'm stopping any further development now, until somebody can provide a solution or workaround for this problem.

You have to describe in your svn commit logs what you actually do. "NG: fixed make all" is not a useful commit message. You changed 149 files in that commit, and did not describe what was done nor why:
* what does all that {$ifdef fix} code do? What does it fix?
* you deleted the aasmsym unit and changed code that depended on it without any remarks why you did that. The comment in the header of that unit said:
"Contains abstract assembler instructions for all processor
types, including routines which depend on the symbol table.
These cannot be in aasmtai, because the symbol table units
depend on that one."

You nevertheless did move that code to aasmtai and now there are indeed (implementation-level) circular dependencies between aasmtai and symsym. Adding extra circular dependencies to the compiler without any argument as to why this is required is not good.
* that commit also contains changes that have nothing to do with fixing "make all", such as fixing a typo in a comment, removing type redefinitions, commenting the assignment of tcgaddnode to caddnode in the init code of ncgadd.pas (and similar assignments in ncgmat), possibly an unrelated change in ppheap (which is wrongly indented), removing an unused local type definition from ppu.pas... 
* I assume that all the code you added in psystem.pas is with the long term view of making the parser independent. However, that is a separate project and not part of removing global variables from the compiler

While reviewing your previous commits, I noticed that you also integrated your patch from http://bugs.freepascal.org/view.php?id=16888 although that one has nothing to do with removing the use of globals.

This way of working is not how we can keep the compiler development manageable for multiple people to work on.


Jonas


More information about the fpc-devel mailing list