[fpc-pascal] Best way to check SimpleIPC for messages

noreply at z505.com noreply at z505.com
Wed May 17 07:08:25 CEST 2017


On 2017-05-15 04:36, Michael Schnell wrote:
> On 12.05.2017 16:37, Michael Van Canneyt wrote:
>> 
>> Check manually. What else is left ? There is no message queue, so no 
>> loop in which to check at regular basis.
>> 
> For event processing in a not threaded project or in the main thread
> of a threaded project you at best use the Event Queue provided by some
> Infrastructure library (e.g. LCL or mse). IMHO, SimpleIPC might makes
> sense, if you don't want to use one of those. (mse and an enhanced
> NoGui LCL "Widget Type", I have done a working draft for, can provide
> a message queue even with no binding to a GUI Widget Set).
> 

Isn't that what the application onidle is for, a way to check messages 
using the application code in the LCL

But a question is (sorry I am not familiar with "onidle"), what happens 
when the application is not idle, but sort of idle? What classifies an 
idle state? i.e. what if the cpu is at 3 percent consumption, or 55 
percent, or 2 percent? What classifies an onidle? this documented 
somewhere?
Is onidle reliable or hit and miss where the app is not idle enough, in 
some cases?

> But when using SimpleIPC for signaling to another process (executable,
> e.g.  a Lazarus "Application" ) I suppose, you  need a thread to avoid
> latency and/or huge CPU demand by polling to transfer the event to the
> Main Thread via the Event Queue (e.g. by Application.QueueAsyncCall or
> TTherad.Queue).

Does onidle need/use any of these?
And, there's always application.processmessages, which.. is poo pooed by 
many



More information about the fpc-pascal mailing list