On Wed, Aug 21, 2013 at 9:36 AM, Mark Morgan Lloyd <[email protected]> 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... -Flávio -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
