[fpc-devel] Suggestion: reference counted objects

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Fri Sep 26 18:06:52 CEST 2014


Michael Schnell wrote:
> On 09/26/2014 05:31 PM, Mark Morgan Lloyd wrote:
>> .
>>
>> A parallel loop syntax is very attractive, but the practical 
>> difficulty is that it would probably have to sit on top of threads and 
>> getting code distributed promptly over multiple worker threads, i.e. 
>> starting up within 10s of nSec rather than 10s of mSec, is non-trivial.
>>
> 
> Starting a new thread of course is too expensive for something like that.

I agree, and I don't think there's a lighter-weight alternative.

> IMHO, the RTL could be provided with a ThreadPool implementation (I just 
> did such a thingy and it seems to work nicely).

Different implementations could potentially use either local threads or 
OpenMPI.

> Same could be accessible by the user for more complex stuff and be used 
> as the infrastructure of a parallel loop syntax.

Agreed, but a good starting point would be working out how to map a 
sequential (non-reentrant) block syntax onto e.g. the existing critical 
section class.

-- 
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-devel mailing list