[fpc-devel] Threads and alot of crap continued

Michael Schnell mschnell at lumino.de
Wed Nov 8 14:22:51 CET 2006


> There is TCustomApplication in fcl/inc/custapp. The Lazarus TApplication descends
> from it. All you need to do is create a descendent of TCustomApplication which
> can implement all the messaging you wish for...
>   
I took a look at TCustomApplication. Same does not provide anything that 
is related to scheduling (e.g.: ProcessMessages), but everything else 
that TApplication has. Supposedly the scheduling stuff is added by Lazarus.

So the way to go is
(1a) do the scheduling stuff based on messages in it's own object.
(1b) do TApplication as a descendant of TCustomApplication and have it 
use the scheduling object.
(1c) do TTimer in a way that it sends messages to the main thread.
(1d )do TThread.Synchronize in a way that it sends messages to the main 
thread.

and later
(2a) do TSchedThread as a descendant of TThread in a way that it uses 
the scheduling object. (it will have things like TSchedThread.Run and 
TSchedThread.ProcessMessages).
(2b) do TTimer in a way that when used with TSchedThread it sends it's 
messages to the appropriate thread


-Michael



More information about the fpc-devel mailing list