[Lazarus] Multi-threading support in IDE

Michael Van Canneyt michael at freepascal.org
Fri Aug 14 09:37:56 CEST 2009



On Fri, 14 Aug 2009, Mattias Gaertner wrote:

> On Fri, 14 Aug 2009 07:16:36 +0200
> Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:
>
>> > BTW, when the compiler has to read and write disk files, a separate 
>> > thread will not speed up much. Then the compiler thread will be
>> > idle much time, waiting for disk I/O, and the main thread will be
>> > idle, waiting for the compiler. IMO.
>> 
>> That's true. The general problem is not that the IDE is not
>> responsive when compiling/linking but that compiling/linking takes so
>> long. If it would be as fast as in Delphi noone would complain.
>
> It takes so long, because compiler and linker have to read all ppus
> on every run. A persistent compiler and linker could keep some things.
>
>
>> And having compiler and linker in separate (asynchronous) threads
>> would be the same as starting them as a new process in asynchronous
>> mode. It would open a can of worms because of synchronising problems.
>
> They only share files. The synchronising is easy. 
>
> The are good reasons to not put the compiler into the same process:
> -a process can be aborted/killed easily
> -various compiler versions
> -compiler crashes do not effect the IDE

Good enough for me NOT to do it. If the compiler was internal to the
IDE, I could not easily compile for 32/64 bit or a different version, 
without including 2+  compilers in the IDE. As it is now, all I must 
do is set the compiler to use.

Florian's option seems a better approach, it would preserve this
possibility.

A sort of 'daemonized fpc'. You could use this as a back-end for a
website: pascal server pages instead of java server pages :-)

Michael.


More information about the Lazarus mailing list