[fpc-pascal] Re: Platform independent alternatives

Burkhard Carstens fpc at bcsoft.de
Fri Jun 24 21:58:35 CEST 2011


Am Freitag, 24. Juni 2011 19:55 schrieb fluisgirardi at gmail.com:
> Some years ago, I started the port of my project (PascalSCADA) from
> Windows to others platforms. I found some issues doing this. I used
> all resources that the FPC RTL can offer.
>
> To thread, I used TThread class. The issues that I found porting
> this, is that Suspend/Resume don't works on others platforms than
> Windows. So I rewrite my code to don't use this.
>
> Windows messages was replaced by a class that I created to exchange
> messages between threads, not process.
>
> TCriticalSection worked as expected on all platforms, except because
> it isn't a recursive mutex on unix, like it's on Windows. Again, a
> little code change to avoid problems.
>
> TEvent works as expected on all platforms since FPC 2.4.x. How it was
> fixed only on FPC 2.4 version AND I want support FPC 2.2.x series, I
> created my own class of Event, based on changes of TEvent class of
> FPC.
>
> Now my project works fine at least on Windows, Linux and FreeBSD,
> using the thread support of FreePascal.
>
> I avoided to use advanced resources of threading of each OS to keep
> my project more platform independently as possible. Functions as
> WaitForSingleObject I'm avoiding to use.
>

This sounds very familiar.
.. the only thing I really miss is the WaitForMULTIPLEObjects ..

b.




More information about the fpc-pascal mailing list