[Lazarus] Using Lazarus for non-graphical apps
Paul Breneman
list2010 at BrenemanLabs.com
Tue Jan 7 16:16:23 CET 2014
On 01/07/2014 08:22 AM, Michael Schnell wrote:
> On 01/07/2014 03:11 PM, Michael Van Canneyt wrote:
>> WakeMainThread may or may not be implemented. You should not count on
>> that.
>
> Right you are.
>
> If you want to have "decent event oriented Pascal programming" (i.e. by
> using TThread.Synchronize and/or TThread.Queue for handling the issues
> the OP requested such as doing blocking I/O in Threads), you need to do
> an environment (which can be seen as a "WidgetType" in Lazarus speak)
> that calls CheckSynchronize in the main thread and that implements
> WakeMainThread to wake the main thread (idle while waiting for a timeout
> in CheckSynchronize) by means of the underlying OS.
>
> TTimer can be implemented on top of that as a Graeme "ThreadTimer" or by
> other means (I intend to provide a very rough TTimer variant based on
> the CheckSynchronize timeout).
I've started providing Lazarus source code for one of my projects:
http://ctrlterm.com/ports.htm
I'd like to add some threading examples, maybe to this page:
http://www.turbocontrol.com/easyfpgui.htm
So please share what you can. Thanks!
More information about the Lazarus
mailing list