Good demo for showing benefits of parallelism

Jascha Wetzel "[firstname]" at mainia.de
Sat Jan 27 07:55:09 PST 2007


Kevin Bealer wrote:
> [...]
> The goal is for all the threads to finish at about the same time.  If
> they don't you end up with some threads waiting idly at the end.
>
> This would require reintroducing a little synchronization.
> [...]

that's all very reasonable, thx.
i changed the job distribution by dividing the image into a grid,
assigning (equally sized) cells to threads in an extending spiral
starting in the middle of the image. this is due to the assumption that
the hardest cells are around the middle (which is the case for the test
scene).
the distribution of those cells is of course synchronized.
new sources: http://mainia.de/prt_grid.zip

now everything is faster, even with one thread. but the speedup with
more threads decreased (time stays about the same for 1-16 threads).
still, i haven't quite "felt" the multicore performance.

meanwhile, a friend tells me, that his speedups with image processing
algorithms and naive block assignment are close to 200%...

atm i suspect there's a more technical reason to that, something with
the threading lib or the like...



More information about the Digitalmars-d mailing list