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

Sven Barth pascaldragon at googlemail.com
Wed May 17 07:54:00 CEST 2017


Am 17.05.2017 07:08 schrieb <noreply at z505.com>:
>
> 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?

OnIdle() is called when there is no more event waiting in the widgetset's
event queue, basically meaning that the application has nothing better to
do anyway. It has nothing to do with CPU usage.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170517/eda09cfc/attachment.html>


More information about the fpc-pascal mailing list