[fpc-devel] Parallel Computing

Florian Klaempfl florian at freepascal.org
Mon Nov 3 22:41:33 CET 2008

Mattias Gaertner schrieb:
> On Mon, 03 Nov 2008 16:29:01 +0100
> Michael Schnell <mschnell at lumino.de> wrote:
>>> Great and you really believe this accelerates a program? Starting a
>>> thread takes a lot of time and such loops are usually memory
>>> throughput bound.
>> OK, I should not have used 10 as the element but 1000000 :). And of 
>> course it makes more sense if a more complex calculation is to be
>> done in each loop. But exactly this issue (lots of independent
>> calculations in parallel) is a widely seen task (e.g points in
>> physical fields).
>> Of course the RTL is not supposed to start a thread for each of the
>> loop runs but assign a number of them to a couple of threads.
> I just completed another example, where threads helped less than
> expected:
> A program that loads tiff images (about 60mb each), resizes and apply
> some filters to them, then saves them. The disk io makes less than 10%
> of the time. The filters are mostly simple loops - perfect for OpenMP.
> There is almost no speed difference from one thread or two threads on
> a two core machine. :(

If the machine has a unified cache for both cores like a core duo there 
is indeed little chance for improvement by MT.

More information about the fpc-devel mailing list