[fpc-pascal] cthreads

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Fri Jul 25 12:24:36 CEST 2014


Michael Van Canneyt wrote:
> On Fri, 25 Jul 2014, Juha Manninen wrote:
> 
>> I was asked why a threaded application compiles on Linux without "uses
>> cthreads" but it does not work.
>> cthreads must _always_ be added to uses section.
>> I had no answer to that. IMO such errors should be trapped at
>> compile-time, not at run-time.
>> Could it be fixed somehow?
> 
> No, because there is no way to detect that threads are actually used in 
> the program.

> I will add a remark in the classes unit TThread class documentation, to 
> make it even more obvious.

Is there scope for improving the error message?

Is there a scenario in which a program that sometimes uses threads (e.g. 
if it realises it's being asked to do a big job which can be 
parallelised) could start without giving the error message? This would 
make the situation more serious, since it would require that the 
programmer did some /real/ testing before shipping his code :-)

-- 
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