Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-06

Lazarus IDE can't multi-task

9 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Is there as specific reason why Lazarus IDE stops compiling a project when I open the 'Environment > Options' dialog? I've tested, and it seems to happen with a lot of dialogs. Start a long running compile - but don't dare open any dialogs in Lazarus IDE, otherwise the compile freezes. Close the dialogs and the compiling continues. I've tested this on a 32-bit and 64-bit machine, and on Linux and Mac OS X. Any no, it's not just the screen refresh that doesn't update - the compiling physically pauses until the dialog closes. ie: hard-drive activity stops too.

Is this by design, or just another bug? I would imagine with todays multi-processor and multi-core systems, software should at least be able to do two or more :
MSEide has no problem with compiling in the background (neither has my experimental IDE), so it can't be a FPC limitation, but rather something specific to Lazarus IDE.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Schnell
to Graeme Geldenhuys

On 06/27/2011 04:10 PM, Graeme Geldenhuys wrote,

Is there as specific reason why Lazarus IDE stops compiling a project when I open the 'Environment> Options' dialog?

I don't think this is desirable. It might result in an inconsistently compiled project.

-Michael

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: Is there as specific reason why Lazarus IDE stops compiling a project when I open the…

?
?

Graeme Geldenhuys hat am 27. Juni 2011 um 16:10
geschrieben:

Show quoted text 11 lines
Hi, Is there as specific reason why Lazarus IDE stops compiling a project when I open the 'Environment > Options' dialog? I've tested, and it seems to happen with a lot of dialogs. Start a long running compile - but don't dare open any dialogs in Lazarus IDE, otherwise the compile freezes. Close the dialogs and the compiling continues. I've tested this on a 32-bit and 64-bit machine, and on Linux and Mac OS X. Any no, it's not just the screen refresh that doesn't update - the compiling physically pauses until the dialog closes. ie: hard-drive activity stops too.?

The IDE reads the output in a loop using Application.ProcessMessages. This means any event pauses reading the output.A ShowModal runs in its own loop, pausing the calling code. That's why.?
Only a rewrite would change this. ?
?

?

Show quoted text 8 lines
Is this by design, or just another bug? I would imagine with todays multi-processor and multi-core systems, software should at least be able to do two or more things at once. NOTE: MSEide has no problem with compiling in the background (neither has my experimental IDE), so it can't be a FPC limitation, but rather something specific to Lazarus IDE.

I already started a rewrite of the IDE's code to execute external tools. But I can't say when it will be ready.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110627/5764189a/attachment.html>

Reply by email

Graeme Geldenhuys
to Michael Schnell: On 06/27/2011 04:10 PM, Graeme Geldenhuys wrote, I don't think this is desirable. It…
Michael Schnell wrote
I don't think this is desirable. It might result in an inconsistently compiled project.

Why? What's wrong with me trying to tweak my editor settings, or doing a keyword search in the source code etc. - while the long running compiling happens in the background?

Yes it might not be a everyday occurrence, but in my case, I did in fact want to adjust my editor settings - but then noticed that the compiling was paused while the dialog was open. I thought this was rather odd.

Yeah sure, there are some caution to be had. For example, maybe make the Project Options (compiler settings areas etc) read-only while a compilation is is progress, but there are many other dialogs which should be usable while compiling is ongoing.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: ? ? Graeme Geldenhuys hat am 27. Juni 2011 um 16:10 geschrieben: The IDE reads the…
Mattias Gaertner wrote
The IDE reads the output in a loop using Application.ProcessMessages.

And that's probably the mistake - a bad design choice. But I guess that can be contributed to the fact that 10 years ago, SMP systems where not that popular as they are today.

Why not have a "populate message window" thread, which reads the compiler output. This thread is launched at the same time as (or by) the "compile my project" thread.

My experimental IDE (which I use purely as a playground for ideas) use the method described above, and it works perfectly without pausing anything - modal dialogs or not.

Thanks for the info though.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys

?
?

Graeme Geldenhuys hat am 27. Juni 2011 um 17:02
geschrieben:

Show quoted text 6 lines
On 06/27/2011 04:47 PM, Mattias Gaertner wrote: > The IDE reads the output in a loop using Application.ProcessMessages. And that's probably the mistake - a bad design choice. But I guess that can be contributed to the fact that 10 years ago, SMP systems where not that popular as they are today.?

Yes, and it has some advantages. For example the code knows that no modal form is open and can therefore open windows and set focus. ?
?

Show quoted text 8 lines
Why not have a "populate message window" thread, which reads the compiler output. This thread is launched at the same time as (or by) the "compile my project" thread. My experimental IDE (which I use purely as a playground for ideas) use the method described above, and it works perfectly without pausing anything - modal dialogs or not.

My rewrite uses threads, so yes, a ShowModal will not stop compilation. If the main thread gets busy, the thread might still get paused, when it needs some information from the main thread.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110627/b053c8ed/attachment.html>

Reply by email

Hans-Peter Diettrich
to Michael Schnell: On 06/27/2011 04:10 PM, Graeme Geldenhuys wrote, I don't think this is desirable. It…
Show quoted text 5 lines
On 06/27/2011 04:10 PM, Graeme Geldenhuys wrote, > Is there as specific reason why Lazarus IDE stops compiling a project > when I open the 'Environment> Options' dialog? I don't think this is desirable. It might result in an inconsistently compiled project.

As Graeme said, why shouldn't it be allowed to adjust e.g. syntax highlighting or window positions, while a compile is running in the background?

Is compilation not thread-safe? ;-)

DoDi

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner: ? ? Graeme Geldenhuys hat am 27. Juni 2011 um 16:10 geschrieben: The IDE reads the…
The IDE reads the output in a loop using Application.ProcessMessages. This means any event pauses reading the output.A ShowModal runs in its own loop, pausing the calling code. That's why.

Is this a blocking read for the compiler output? Why?

I already started a rewrite of the IDE's code to execute external tools. But I can't say when it will be ready.

Can it be that your attempts made code completion so fragile? Currently I have to invoke (CTRL-space) and abort code completion several times, until only a single identifier is inserted :-(

DoDi

Reply by email

Mattias Gaertner
to Hans-Peter Diettrich

?
?

Hans-Peter Diettrich hat am 27. Juni 2011 um 19:26 geschrieben:

Show quoted text 7 lines
Mattias Gaertner schrieb: > The IDE reads the output in a loop using Application.ProcessMessages. > This means any event pauses reading the output.A ShowModal runs in its > own loop, pausing the calling code. That's why. Is this a blocking read for the compiler output? Why??

It is a matter of buffer size. If the fpc output does not fit into the TProcess buffer, then fpc has to wait for the IDE to read from the buffer. It uses the default buffer size. Maybe this can be increased. Find out how and tell.?
?
?

Show quoted text 5 lines
> I already started a rewrite of the IDE's code to execute external tools. > But I can't say when it will be ready. Can it be that your attempts made code completion so fragile??

Unlikely. Because I have not committed one line of that code.?

?

Currently I have to invoke (CTRL-space) and abort code completion several times, ? until only a single identifier is inserted :-(

It works here. Is this reproducable?

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110627/557036d7/attachment-0001.html>

Reply by email