[fpc-devel] Compiler trheads

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Aug 12 15:54:33 CEST 2010


Florian Klaempfl schrieb:

>> Brainstorming: What other models come into mind, for using threads in
>> the compiler?
> 
> The "final" plan is to use a task queue with dependencies and all needed
> information.

The unit dependencies are known only after their "uses" clauses have 
been parsed. After the used units in the interface part have been 
parsed, the parser can continue until he must wait again for used units 
in the implementation part.

The current model does a "depth first" parse, switching to every used 
unit. The unit with all dependencies resolved can run until completion, 
and a switch back to the previously active parser is made. I.e. parallel 
processing can only start after a unit with no further dependencies has 
been found (parsed past the implementation uses). Then the remainder of 
the unit can be processed (parsed and compiled) in parallel with other 
tasks.

DoDi




More information about the fpc-devel mailing list