[Lazarus] Multi-threading support in IDE

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Aug 13 22:14:23 CEST 2009


On Thu, 13 Aug 2009 12:40:54 +0200
Graeme Geldenhuys <graemeg at opensoft.homeip.net> wrote:

> Hi,
> 
> Does the Lazarus IDE use multi-threading for anything?

It is single threaded.


> Will it take advantage of a Quad Core processor?

Not yet.

 
> Examples where I think it could be used (if not already)
>   - background parsing of units

Yes, this is planned. Some expensive parts can be done in worker
threads. But it is no simple task. Keep in mind that the codetools do
not parse in one run like the compiler and they update a lot of caches.

>   - fpdoc lookups

That should be easier. This already works in several separate parts
executed on idle.

>   - compile project in separate thread (currently the IDE is
>     almost completely non responsive when compiling)

That should be the easiest:
The compiler is an external process and TAsyncProcess is already
available. The only problem is that TAsyncProcess bites the debugger
under Linux. Compile LCL and IDE with -dUseAsyncProcess. Run an
application. Close the IDE. The gui will close, but lazarus is still
running.

 
> I'm sure there are many other areas as well?

I'm not so sure.
For example: An expensive function is "Find in files" which could be
multithreaded. But the bottleneck here is the memory system and the
disk, not the cpu.

 
> Does anybody know if FPC takes multiple cores in consideration when 
> compiling?

AFAIK Florian did some tests years ago and the bottleneck was the
memory system and the disk.


Mattias




More information about the Lazarus mailing list