[fpc-devel] Threads and alot of crap continued

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Nov 7 10:07:02 CET 2006



On Tue, 7 Nov 2006, Michael Schnell wrote:

> Hi FPC experts.
> 
> I read this thread in the list archive and as I'm very interested in this
> topic (since years), I'm very happy do see this evolving and would like to
> provide some comment (and maybe contribute some code once I'm up to speed with
> FPC) and, of course, ask questions.
> 
> 1) How is the state on this issue? Does the latest released version of the FPC
> RTL already provide a decent implementation of the threading primitives known
> from Delphi ? (e.g. TThread.Suspend, TThread.Synchronize, TEvent,
> TCriticalSection, TThreadList, etc) as well for Linux as for Windows etc.?
> What about WinCE on ARM and Linux on ARM and 68K ?

It does.

> 
> 2) IMHO FPC is a lot about platform independency. In Delphi/Kylix there never
> was a decent platform independent way of inter thread message passing. Are
> there any plans on this ? 

None currently. Only 'Synchronize' is implemented.

> IMHO a perfect way would need a language enhancement
> (a way to fire events that are to run in another thread context, which would
> also involve enhancing/creating the message scheduler in the RTL to work not
> only for the main thread but for any worker thread, too), but supposedly a
> thing easier to agree about could be something like a "TThreadMessage" class
> in the RTL that fires an event in the main thread when a message from a worker
> thread comes in and for worker threads provides a means to check if a message
> is available and optionally wait for one.

Feel free to implement this, but not as a language enhancement, a simple
unit should be enough. 

> 3) Does TTimer work in Linux, now, ? Last time I checked I did not get it
> running.

It works.

Michael.



More information about the fpc-devel mailing list