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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to