[fpc-devel] Threads and alot of crap continued

Michael Schnell mschnell at lumino.de
Thu Nov 9 12:58:48 CET 2006


> Alas, Object Pascal 
> lacks a decent portable OS tasking interface.
>   
With Delphi we successfully used Windows Messages for inter Thread 
communication.

With FPC on Linux a friend of mine used System 5 Messages queues for the 
same purpose.

So IMHO inter Thread messages is a good way to go.

As neither Delphi nor FPC have a portable way to use inter Thread 
messages, in both simply the system API encapsulations provided were used.

This is why I vote for doing a portable implementation of inter Thread 
messaging, including firing an event (at first only in the main thread) 
when a message arrives. Of course a Delphi/Lazarus compatible GUI-less 
TTimer implementation can easily be made on top of this.

In Delphi there is a way to register Windows message callbacks for the 
GUI thread in a very Windowish way. I don't know if the Lazarus people 
implemented something like this and if it's portable.

-Michael



More information about the fpc-devel mailing list