OpenMP and krita

Cyrille Berger cberger at cberger.net
Wed May 16 23:48:19 CEST 2007


Hello,

With the recently released gcc 4.2, comes support for OpenMP 
(http://en.wikipedia.org/wiki/OpenMP) which allow to easily add 
multithreading computation.

Compared to ThreadWeaver, the main advantage is that it is much more easier to 
multithread a loop (just add a line #pragma omp parallel for) then 
ThreadWeaver has the advantage that it gives you much more controls on your 
threads, error handling and it doesn't need gcc 4.2 :)

That said an interesting place to use OpenMP I think might be some simple loop 
we have like in the composite op.
We might have to rewrite them from
while(nbpixel > 0)
{
 *it=smthg;
 ++it;
 --nbpixel;
}
to
for(i = 0 to nbpixel)
{
 it[i] = smthg;
}

It might be interesting to see if that brings something when gcc 4.2 is more 
widely available :)

-- 
Cyrille Berger


More information about the kimageshop mailing list