[Lazarus] Shell notifications

Flávio Etrusco flavio.etrusco at gmail.com
Wed Aug 21 18:17:34 CEST 2013

On Wed, Aug 21, 2013 at 9:36 AM, Mark Morgan Lloyd
<markMLl.lazarus at telemetry.co.uk> wrote:
> Michael Schnell wrote:
>> On 08/20/2013 02:56 PM, Henry Vermaak wrote:
>>> ... together with select()..
>> In Object Pascal I think this should be encapsulated in a thread and same
>> fires a main Thread event (via TThread.Queue, TThread.Synchronize, or
>> Application.QueueAsyncCall) to notify the user (aka Main Thread).
> I know it's the obvious way, but surely there is something more elegant than
> having a thread which exists solely to transfer the result of a select() to
> the main part of the app, and then repeats.
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk

IMO there should be a basic component which just provides the platform
abstraction to block/wait on the change notification (probably
inheriting from SyncObjs.THandleObjects?), and build on that to
implement the daemon/thread.

Unless, of course, it make the design for handling several events with
a single thread much more cluttered; but at least Windows
(FindFirstChangeNotification) and Linux (inotify) provide
wait/blocking-read semantics for these events...


More information about the Lazarus mailing list