[fpc-pascal] cthreads

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sun Jul 27 11:39:44 CEST 2014


Sven Barth wrote:
> On 26.07.2014 19:50, leledumbo wrote:
>>> Because then all apps are linked to it, also the ones that don't need
>> threads. Same for clocale and cwstrings.
>>
>> If the widestring manager could be made by ourselves, is it possible for
>> thread manager as well?
> 
> Principiall yes, but the problem here would be external code that the 
> program links to. E.g. Wine did something like this some time ago 
> (before they switched to pthreads) and needed to simulate some 
> structures so that libc switches to multithreaded mode... So if we have 
> Pascal only code (like the compiler) this would work without big 
> problems (if someone implements it of course ;) ), but if you have 3rd 
> party code not written in FPC then problems might arise...

On the other hand, if somebody's linking in "alien" code then he should 
make himself aware of aware of the prerequisites, particularly since the 
threads are more likely to be in the main program (i.e. stuff that he's 
written) than in the library he's pulling in.

Going back to something less labour intensive, would it be possible to 
have s directive which has the effect that if a procedure isn't 
eliminated by smartlinking then the linker should warn if a specific 
library hasn't been linked?

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