[fpc-pascal] alternatives for "cwstring" and "cthreads"

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Fri Dec 11 20:51:10 CET 2015


Jonas Maebe wrote:
> Graeme Geldenhuys wrote on Fri, 11 Dec 2015:
> 
>> Both the "cwstring and "cthreads" units (as per the documentation) says
>> that it links to the C library of unix systems.
>>
>> Does this make your programs more dependent on a specific version of the
>> C library? Or can you run a current unix program (say compiled on the
>> latest Ubuntu Linux) on say a 10 year old Linux? [lets assume it is a
>> console or daemon application, not GUI]
> 
> Most likely yes. E.g., a dummy program containing just this:
> 
> ***
> uses
>   cthreads, cwstring;
> begin
> end.
> ***
> 
> works fine when compiled on
> "Linux xxx 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 06:46:41 EDT 2010 
> x86_64 x86_64 x86_64 GNU/Linux" against GLibC 2.5 and when run on "Linux 
> YYY 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 
> x86_64 x86_64 GNU/Linux" with EGLibC 2.19. Vice verse works fine too.

I agree for what it's worth, there are areas that are far less stable.

Working from memory, the one area where one might need to be careful is 
if looking at thread IDs to determine whether a piece of code is 
executing in the context of the main thread, since the semantics changed 
at some point and the changes happened at different kernel/library 
versions on different architectures.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list